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
65
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
66
Other Decks in Research
See All in Research
博士学位論文予備審査 / Scaling Telemetry Workloads in Cloud Applications: Techniques for Instrumentation, Storage, and Mining
yuukit
1
1.7k
Whoisの闇
hirachan
3
280
AWS 音声基盤モデル トーク解析AI MiiTelの音声処理について
ken57
0
130
ドローンやICTを活用した持続可能なまちづくりに関する研究
nro2daisuke
0
130
PhD Defence: Considering Temporal and Contextual Information for Lexical Semantic Change Detection
a1da4
0
110
メタヒューリスティクスに基づく汎用線形整数計画ソルバーの開発
snowberryfield
3
760
Retrieval of Hurricane Rain Rate From SAR Images Based on Artificial Neural Network
satai
2
130
医療支援AI開発における臨床と情報学の連携を円滑に進めるために
moda0
0
150
20241115都市交通決起集会 趣旨説明・熊本事例紹介
trafficbrain
0
980
PostgreSQLにおける分散トレーシングの現在 - 第50回PostgreSQLアンカンファレンス
seinoyu
0
230
Elix, CBI2024, スポンサードセッション, Molecular Glue研究の展望:近年の進展とAI活用の可能性
elix
0
130
20241226_くまもと公共交通新時代シンポジウム
trafficbrain
0
400
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
We Have a Design System, Now What?
morganepeng
51
7.4k
What's in a price? How to price your products and services
michaelherold
244
12k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
320
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/