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
Git magic tricks
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Xavier F. Gouchet
April 04, 2018
Programming
20
0
Share
Git magic tricks
A lightning talks with a few Git configuration magic tricks
Xavier F. Gouchet
April 04, 2018
More Decks by Xavier F. Gouchet
See All by Xavier F. Gouchet
Writing a Kotlin Compiler Plugin
xgouchet
0
67
Being an ethical software engineer
xgouchet
0
330
Libérez votre créativité
xgouchet
0
150
Unleash your Programming Creativity
xgouchet
0
220
Demystifying the Test Pyramid
xgouchet
1
690
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
140
Property Based Testing in Practice
xgouchet
0
110
Develop your CI tools
xgouchet
2
480
How to write a safe and reliable Open Source Library
xgouchet
1
330
Other Decks in Programming
See All in Programming
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
300
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
700
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2k
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
890
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
120
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
320
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
240
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.7k
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
150
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
130
GitHubCopilotCLIをはじめよう.pdf
htkym
0
290
Swift Concurrency Type System
inamiy
1
560
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
320
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
500
Faster Mobile Websites
deanohume
310
31k
My Coaching Mixtape
mlcsv
0
110
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
290
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
190
Design in an AI World
tapps
1
200
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
330
How to train your dragon (web standard)
notwaldorf
97
6.6k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Transcript
GIT MAGIC TRICKS CodeMobile UK 2018 1
ABOUT… XAVIER F. GOUCHET LEAD ANDROID ENGINEER AT WORKWELL FLUENT
IN ANDROID SINCE CUPCAKE ON ALL SOCIAL NETWORKS @XGOUCHET 2
FOREWORD EDIT THE CONFIG FILES : Local: /…/repo/.git/config Global (per
user) : ~/.gitconfig System : /etc/gitconfig [group] property = value 3
IN THE TERMINAL $ git config group.property "Foo" $ git
config --global group.property "Bar" $ git config --system group.property "Baz" 4
ALIASES [alias] lg = log --pretty=format:"%Cyellow%h %ad %Cwhite%s" $ git
lg 5
YOU'RE HERE ↓ [alias] # WTF was I working on
earlier… ? wtf = "!git status --short --branch; echo -e '\nThe last 3 commits was :'; git lg -3 --numstat" 6
SHORT TERM MEMORY LOSS [alias] # log only my commits
mine = lg --author="$(git config user.email)" # log my commits since yesterday standup = !git mine --since yesterday 7
TAKE OUT THE TRASH [alias] # dmb = delete-merged-branches dmb
= "!git branch --no-color --merged | egrep -v "(^\*|master|develop)" | xargs -I{} git branch -d {}" 8
WHAT'S UP, DOC ? [alias] update = "!git pull -r
&& git dmb && git wtf" sync = "!git pull -r && git push" 9
REWRITING HISTORY [alias] # Amend last commit amend = commit
--amend # Amend without prompting for a message update comend = commit --amend --no-edit # Create a fixup commit (git fixup 35d15a2) fixup = commit --fixup 10
CAN I HAVE SOME MORE, PLEASE ? [alias] # never
push force ! please = push --force-with-lease 11
TO ERR IS HUMAN, BUT A REAL DISASTER NEEDS A
GIT CLIENT [alias] # undo `git [add|rm] …` unstage = reset --mixed # undo `git commit …`, keep the changes uncommit = reset --soft HEAD^ # undo `git commit …`, drop the changes ⚠ rollback = reset --hard HEAD^ 12
I HAVE SEXDAILY... DISLEXIA... DAMN AUTOCORRECT! [help] # execute the
mistyped command after 50 deciseconds (5s) autoCorrect = 50 [alias] cehcout = checkout cmomit = commit 13
AN ACCIDENT WAITING TO HAPPEN “Some fixes.” “Should work now…
I think” “You won't believe what this developer did to fix the bug !” [alias] yolo = "!git add -a && commit -m "$(curl -s whatthecommit.com/index.txt)" 14
WANT MORE ? 🔎 .gitconfig on GitHub gists 🔎 git
aliases on GitHub or just Google If you type it more than twice, make an alias of it 15
DEMO TIME 16
DEMO TIME 17
QUESTIONS 18
QUESTIONS 19
GIT HOOKS 20
GIT HOOKS NEXT TIME… MAYBE ? THANK YOU FOR YOUR
ATTENTION 21