3 ms·
The exhortation to do atomic commits is a good one but slightly impractical; for whatever reason, I just don’t often think “I should commit this change” during
by fwlr 4y ago
The exhortation to do atomic commits is a good one but slightly impractical; for whatever reason, I just don’t often think “I should commit this change” during flow state. I did find a semi-practical way of partially implementing atomic commits anyway: rather than git add all, I git add one file and commit, then repeat. It’s not perfect, you do have to review the diff to check for coupled changes (changing a route on the server and the corresponding call on the client, for example), but it’s often possible to “atomicise” your changes into a half dozen commits.
- mjsir911 4y agoI tend to use `git add -p` for exactly this purpose ;-)
- hoseja 4y agoI really hate how there's a smallest possible chunk you can't split any further/do line-by-line commits without a lot of hassle.
- fwlr 4y agoHoly hell I had no idea git had that feature, that’s amazing. You’ve significantly improved my workflow
- pabs3 4y agoEven better is `git gui`, it lets you stage individual line changes.