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
atomic commits
Search
Kai Howelmeyer
January 21, 2014
Research
0
72
atomic commits
Kai Howelmeyer
January 21, 2014
Tweet
Share
More Decks by Kai Howelmeyer
See All by Kai Howelmeyer
git tricks
kaihowl
3
120
git intro by mkilling
kaihowl
1
69
Other Decks in Research
See All in Research
大規模な2値整数計画問題に対する 効率的な重み付き局所探索法
mickey_kubo
1
240
データサイエンティストの就労意識~2015→2024 一般(個人)会員アンケートより
datascientistsociety
PRO
0
660
NLP2025参加報告会 LT資料
hargon24
1
320
SSII2025 [TS3] 医工連携における画像情報学研究
ssii
PRO
2
1.1k
ASSADS:ASMR動画に合わせて撫でられる感覚を提示するシステムの開発と評価 / ec75-shimizu
yumulab
1
380
(NULLCON Goa 2025)Windows Keylogger Detection: Targeting Past and Present Keylogging Techniques
asuna_jp
1
520
rtrec@dbem6
myui
6
860
生成的推薦の人気バイアスの分析:暗記の観点から / JSAI2025
upura
0
180
Combinatorial Search with Generators
kei18
0
300
公立高校入試等に対する受入保留アルゴリズム(DA)導入の提言
shunyanoda
0
5.7k
Looking for Escorts in Sydney?
lunsophia
1
120
AIによる画像認識技術の進化 -25年の技術変遷を振り返る-
hf149
6
3.4k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
28
5.4k
Designing for Performance
lara
609
69k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Fireside Chat
paigeccino
37
3.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Why You Should Never Use an ORM
jnunemaker
PRO
57
9.4k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Raft: Consensus for Rubyists
vanstee
140
7k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.3k
How to train your dragon (web standard)
notwaldorf
93
6.1k
Transcript
atomic commits Kai Höwelmeyer @kaihowl git aficionados meetup 01/21/14
atomic commit A commit only containing changes that logically belong
together and cannot be split up any further without breaking the intent of the commit.
Keep the history clean. Convey intent. Don’t repeat the diff.
Features are seldom straight- forward. But your commits should be!
Dissect your feature into: Necessary changes & the actual feature
implementation
But how?
Commit early and often on a feature branch. It works
Fixed a typo Added a test Refactored a li6le Added another part Improved performance
When done, git merge -‐-‐squash on master
Master Commit 1 Master Commit 2 … Master Commit n Our enBre feature staged
Now git reset
Then git add -‐p Only choose hunks that belong
into one atomic commit. Master Commit 1 Master Commit 2 … Master Commit n Remainder unstaged Atomic Commit 1 staged
Check with git diff -‐-‐staged
Master Commit 1 Master Commit 2 … Master Commit n Remainder unstaged Atomic Commit 1 staged
Commit with meaningful message. Master Commit 1 …
Master Commit n Atomic Commit 1 Remainder unstaged
git stash -‐u Leaves clean working copy. Check integrity
of system. Master Commit 1 … Master Commit n Atomic Commit 1 Remainder stashed
git stash pop Stage next atomic commit with git
add -‐p Master Commit 1 … Master Commit n Atomic Commit 1 Remainder unstaged Atomic Commit 2 staged
Final check git diff ..feature-‐branch Did I commit
everything?
Next time Determine code ownership w/ log & blame -
or - How I fell in love with vim-fugitive
@kaihowl
Image Sources • http://www.flickr.com/photos/lij/ 122525716/sizes/l/ • http://www.flickr.com/photos/ diorama_sky/4557914779/sizes/l/ • http://www.flickr.com/photos/
camknows/3821001012/