Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Practical git(lab)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
[email protected]
May 22, 2015
Programming
1
170
Practical git(lab)
Git best practices, tips & tricks. Talk given to my teammates at Ideaknow.
[email protected]
May 22, 2015
Tweet
Share
More Decks by
[email protected]
See All by
[email protected]
Making Xcode build times great again
xavierjurado
0
140
Practical Git(Hub)
xavierjurado
5
330
Programación concurrente con GCD
xavierjurado
1
170
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
590
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
高速開発のためのコード整理術
sutetotanuki
1
390
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
CSC307 Lecture 03
javiergs
PRO
1
490
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
0
740
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
AI: The stuff that nobody shows you
jnunemaker
PRO
2
240
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
So, you think you're a good person
axbom
PRO
2
1.9k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
300
A Soul's Torment
seathinner
5
2.2k
Practical Orchestrator
shlominoach
191
11k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Transcript
Practical git(lab) no theory today, I promise!
Best practices Tips & tricks Rebase & you Terminal hackery
❝ git gets easier once you get the basic idea
that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space ❞ -- The Internet
❝ SourceTree sucks ❞ -- Me
Best practices Good
commit commit often write good commit messages do not commit
unrelated changes together
commit commit often write good commit messages do not commit
unrelated changes together
branches anything in master is deployable anything in develop will
be delivered in the next release * feature-branches is where we should commit
branches anything in master is deployable anything in develop will
be delivered in the next release * feature-branches is where we should commit
* Well, unless the client calls in the last minute
to demand ask you politely to drop a feature because they fucked up had some issues on their side. Something that never happens. Ever. Nope. branches
branches It’s ok to have different branch schemes, depends on
client, project, technology… a common workflow > no workflow at all keep it simple or people won’t follow the scheme
.gitignore know and use .gitignore committed files cannot be ignored
(well, not easily) https://github.com/github/gitignore
git pull God kills a kitten every time you do
this: Merge branch 'develop_15.5' of gitlab.ideaknow.com:sab-3-0/bsmobil- translations into develop_15.5
None
git pull git pull is considered harmful git fetch origin
git rebase origin/develop git config --global pull.ff only when changes can’t be applied fast-forward:
git pull do it for the kittens if you need
to solve conflicts when pushing/ pulling, you are doing something wrong
merge request why? we all make errors find logic bugs
high quality code enforce readable code style enforce good commit history let people know what you are working on learn (both ways) fun
merge request revelation
merge request useful messages: “Can we make this more readable?”
“What would be a better name for this method?” “This needs to be refactored into smaller methods” “”
merge request be the first to review your own code
learn to criticise and to be criticised your work != you open a merge request at any time, even to discuss an upcoming feature
clean history
Tips & tricks
How do I… …search all of git history for a
string? git log --all -G <string>
How do I… …find the commit that broke my project?
git bisect start git bisect good git bisect bad
How do I… …save current changes for later use without
committing because you need to do something urgent? git stash git stash list git stash pop git stash apply
How do I… …revert a non-staged change? git checkout --
path/to/file/to/revert git checkout -- . …revert all non-staged changes (and nothing else)? ⚠ ⚠
How do I… …revert a staged change? git reset path/to/file/to/revert
git reset …revert all staged changes (and nothing else)?
How do I… …revert all staged and non-staged changes? (i.e.:
all non-committed changes) git reset --hard ⚠
How do I… …revert the last non-pushed commit? git reset
HEAD^ …revert/modify a previous non-pushed commit? git rebase -i <parent commit>
How do I… …revert a pushed change? git revert <commit
sha>
How do I… …copy an existing commit (from another branch
or another point in history) ? git cherry-pick <commit SHA>
How do I… …split changes in a single file into
multiple commits? git add -p <file>
How do I… …clean remote branches? git remote prune origin
git push origin --delete <branch_name> …delete a remote branch?
How do I… … remove untracked files and directories? git
clean -d -f ⚠
How do I… … show changes introduced by a commit?
git show <commit sha> … show changes introduced by a merge commit? git show -m <commit sha>
How do I… … find who the fuck wrote this
aberration? git blame path/to/aberration
Rebase & you
… rypress.com/tutorials/git/rebasing.html?
Terminal hackery
autocompletion & prompt brew install bash-completion brew install git
better git log git config --global alias.lg "log --color --graph
-- pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias! `wo` credits: https://twitter.com/_supermarin
Questions?
Thanks!