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
61
atomic commits
Kai Howelmeyer
January 21, 2014
Tweet
Share
More Decks by Kai Howelmeyer
See All by Kai Howelmeyer
git tricks
kaihowl
3
110
git intro by mkilling
kaihowl
1
65
Other Decks in Research
See All in Research
The many faces of AI and the role of mathematics
gpeyre
1
1.4k
The Fellowship of Trust in AI
tomzimmermann
0
150
Weekly AI Agents News! 10月号 論文のアーカイブ
masatoto
1
400
さんかくのテスト.pdf
sankaku0724
0
520
多様かつ継続的に変化する環境に適応する情報システム/thesis-defense-presentation
monochromegane
1
590
最近のVisual Odometryと Depth Estimation
sgk
1
310
情報処理学会関西支部2024年度定期講演会「自然言語処理と大規模言語モデルの基礎」
ksudoh
10
2.1k
ニュースメディアにおける事前学習済みモデルの可能性と課題 / IBIS2024
upura
3
680
RSJ2024「基盤モデルの実ロボット応用」チュートリアルA(河原塚)
haraduka
3
700
精度を無視しない推薦多様化の評価指標
kuri8ive
1
290
Weekly AI Agents News! 8月号 プロダクト/ニュースのアーカイブ
masatoto
1
210
129 2 th
0325
0
250
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.1k
Music & Morning Musume
bryan
46
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Making the Leap to Tech Lead
cromwellryan
133
9k
Designing for humans not robots
tammielis
250
25k
GraphQLとの向き合い方2022年版
quramy
44
13k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Rails Girls Zürich Keynote
gr2m
94
13k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
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/