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
Xavier F. Gouchet
PRO
April 04, 2018
Programming
18
0
Share
Git magic tricks
A lightning talks with a few Git configuration magic tricks
Xavier F. Gouchet
PRO
April 04, 2018
More Decks by Xavier F. Gouchet
See All by Xavier F. Gouchet
Writing a Kotlin Compiler Plugin
xgouchet
PRO
0
66
Being an ethical software engineer
xgouchet
PRO
0
330
Libérez votre créativité
xgouchet
PRO
0
150
Unleash your Programming Creativity
xgouchet
PRO
0
210
Demystifying the Test Pyramid
xgouchet
PRO
1
680
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
PRO
0
130
Property Based Testing in Practice
xgouchet
PRO
0
110
Develop your CI tools
xgouchet
PRO
2
470
How to write a safe and reliable Open Source Library
xgouchet
PRO
1
330
Other Decks in Programming
See All in Programming
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
830
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
100
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
540
20260315 AWSなんもわからん🥲
chiilog
2
190
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
180
Coding as Prompting Since 2025
ragingwind
0
750
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
430
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
970
飯MCP
yusukebe
0
480
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
AIと共にエンジニアとPMの “二刀流”を実現する
naruogram
0
130
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
ラッコキーワード サービス紹介資料
rakko
1
2.9M
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
Site-Speed That Sticks
csswizardry
13
1.1k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
92
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