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
Git magic tricks
Search
Xavier F. Gouchet
April 04, 2018
Programming
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
89
Being an ethical software engineer
xgouchet
0
360
Libérez votre créativité
xgouchet
0
190
Unleash your Programming Creativity
xgouchet
0
240
Demystifying the Test Pyramid
xgouchet
1
790
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
0
160
Property Based Testing in Practice
xgouchet
0
140
Develop your CI tools
xgouchet
2
530
How to write a safe and reliable Open Source Library
xgouchet
1
380
Other Decks in Programming
See All in Programming
Jetpack Compose Mechanisms
skydoves
3
800
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
AmebaブログはKMPから卒業します
kmars0605
0
160
Workers Cache を知る
syumai
0
360
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
ChromeでローカルLLM
ryu1013
0
140
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
210
APNsからLive Activityを開始する話
yumnumm
0
170
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
SREの越境 / SRE Collaboration
y0hgi
2
310
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Featured
See All Featured
A better future with KSS
kneath
240
18k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Statistics for Hackers
jakevdp
799
230k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
How STYLIGHT went responsive
nonsquared
100
6.3k
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