Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Practical git(lab)
Git best practices, tips & tricks. Talk given to my teammates at Ideaknow.
[email protected]
May 22, 2015
More Decks by
[email protected]
See All by
[email protected]
Making Xcode build times great again
xavierjurado
0
150
Practical Git(Hub)
xavierjurado
5
370
Programación concurrente con GCD
xavierjurado
1
200
Other Decks in Programming
See All in Programming
Webの地図
yosuke_furukawa
PRO
6
4.7k
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
710
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
250
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
500
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
360
Intent as Code
shoppingjaws
6
1.1k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
460
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
260
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
430
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.4k
Java 27新機能 / Java 27 new features
kishida
2
150
What We Talk About When We Talk About XP
m_seki
2
660
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.7k
ラッコキーワード サービス紹介資料
rakko
1
4.9M
Bash Introduction
62gerente
615
220k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
500
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
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!