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
17
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
62
Being an ethical software engineer
xgouchet
PRO
0
320
Libérez votre créativité
xgouchet
PRO
0
150
Unleash your Programming Creativity
xgouchet
PRO
0
210
Demystifying the Test Pyramid
xgouchet
PRO
1
660
Successfully Publishing a Tested, Upgradeable and Documented Open Source Library
xgouchet
PRO
0
130
Property Based Testing in Practice
xgouchet
PRO
0
100
Develop your CI tools
xgouchet
PRO
2
460
How to write a safe and reliable Open Source Library
xgouchet
PRO
1
320
Other Decks in Programming
See All in Programming
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
150
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.9k
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.2k
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
400
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
480
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
OTP を自動で入力する裏技
megabitsenmzq
0
120
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
220
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
440
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
6
2.3k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
130
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
150
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
HDC tutorial
michielstock
1
560
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
110
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
200
Evolving SEO for Evolving Search Engines
ryanjones
0
160
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Designing Powerful Visuals for Engaging Learning
tmiket
0
290
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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