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
51
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
62
Other Decks in Research
See All in Research
Active Retrieval Augmented Generation
kiyohiro8
3
440
CVPR2023 EarthVision Workshopより衛星画像関連論文紹介 / Satellite Imaging Processing Papers in CVPR2023 EarthVision Workshop
nttcom
0
110
第59回名古屋CV・PRMU勉強会:ICCV2023論文紹介(自己教師あり学習)
naok615
0
310
第4回ナレッジグラフ勉強会:ISWC2023論文読み会
kg_wakate
1
200
Scaling Rectified Flow Transformers for High-Resolution Image Synthesis / Stable Diffusion 3
shunk031
0
440
Breaking Tradeoffs: Extremely Scalable Multi-Agent Pathfinding Algorithms
kei18
0
140
FMP L3 Year 1 Project Proposal
haiinya
0
150
眠眠ガチャ:ガチャを活用した睡眠意欲向上アプリの開発 / EC71inui
yumulab
0
120
Accurate Method and Variable Tracking in Commit History
tsantalis
0
240
[Human-AI Decision Making勉強会] 説明の更新はユーザにどのような影響をもたらすか
okoso
1
150
Generative Spoken Dialogue Language Modeling [対話論文読み会@電通大]
yuta0306
1
130
訓練データ作成のためのCloudCompareを利用した点群の手動ラベリング
kentaitakura
0
510
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
76
41k
The Invisible Side of Design
smashingmag
294
49k
Building Effective Engineering Teams - LeadDev
addyosmani
27
1.8k
The Power of CSS Pseudo Elements
geoffreycrofte
59
5k
GitHub's CSS Performance
jonrohan
1023
450k
Rails Girls Zürich Keynote
gr2m
91
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Statistics for Hackers
jakevdp
789
220k
Designing for humans not robots
tammielis
247
25k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Designing the Hi-DPI Web
ddemaree
276
33k
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/