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
0
14
Git magic tricks
A lightning talks with a few Git configuration magic tricks
Xavier F. Gouchet
PRO
April 04, 2018
Tweet
Share
More Decks by Xavier F. Gouchet
See All by Xavier F. Gouchet
Writing a Kotlin Compiler Plugin
xgouchet
PRO
0
39
Being an ethical software engineer
xgouchet
PRO
0
300
Libérez votre créativité
xgouchet
PRO
0
120
Unleash your Programming Creativity
xgouchet
PRO
0
190
Demystifying the Test Pyramid
xgouchet
PRO
1
580
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
PRO
0
120
Property Based Testing in Practice
xgouchet
PRO
0
89
Develop your CI tools
xgouchet
PRO
2
430
How to write a safe and reliable Open Source Library
xgouchet
PRO
1
290
Other Decks in Programming
See All in Programming
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
670
AIを駆使して新しい技術を効率的に理解する方法
nogu66
1
610
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
300
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
690
Honoを技術選定したAI要件定義プラットフォームAcsimでの意思決定
codenote
0
160
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.6k
What's New in Web AI?
christianliebel
PRO
0
120
AI 時代だからこそ抑えたい「価値のある」PHP ユニットテストを書く技術 #phpconfuk / phpcon-fukuoka-2025
shogogg
1
420
MCPサーバー「モディフィウス」で変更容易性の向上をスケールする / modifius
minodriven
8
1.4k
知られているようで知られていない JavaScriptの仕様 4選
syumai
0
580
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
560
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
140
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Six Lessons from altMBA
skipperchong
29
4.1k
Designing Experiences People Love
moore
142
24k
Unsuck your backbone
ammeep
671
58k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
670
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
24
1.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
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