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
60
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
64
Other Decks in Research
See All in Research
2024/10/30 産総研AIセミナー発表資料
keisuke198619
1
330
ニューラルネットワークの損失地形
joisino
PRO
35
16k
Introducing Research Units of Matsuo-Iwasawa Laboratory
matsuolab
0
900
Global Evidence Summit (GES) 参加報告
daimoriwaki
0
140
データサイエンティストをめぐる環境の違い 2024年版〈一般ビジネスパーソン調査の国際比較〉
datascientistsociety
PRO
0
560
129 2 th
0325
0
240
Active Adaptive Experimental Design for Treatment Effect Estimation with Covariate Choices
masakat0
0
220
MIRU2024_招待講演_RALF_in_CVPR2024
udonda
1
330
Language is primarily a tool for communication rather than thought
ryou0634
4
740
尺度開発における質的研究アプローチ(自主企画シンポジウム7:認知行動療法における尺度開発のこれから)
litalicolab
0
340
Leveraging LLMs for Unsupervised Dense Retriever Ranking (SIGIR 2024)
kampersanda
2
180
ミニ四駆AI用制御装置の事例紹介
aks3g
0
160
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Embracing the Ebb and Flow
colly
84
4.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
For a Future-Friendly Web
brad_frost
175
9.4k
Side Projects
sachag
452
42k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
4 Signs Your Business is Dying
shpigford
180
21k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Docker and Python
trallard
40
3.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/