3 ms·
Honestly I think the best thing you can do towards making good commits is having a good GUI client and using it well. What I do is, after I'm done making a mes
by boardwaalk 10y ago
Honestly I think the best thing you can do towards making good commits is having a good GUI client and using it well.
What I do is, after I'm done making a mess of things, I click through each new/changed file and study the diff. I might need to commit or discard or edit specific chunks, but at the end everything is staged. Then I can click through the staged files quickly to check for mistakes while formulating a good commit message.
(You could also use DIFF=vimdiff or something too)
I find looking at individual hunks and files and staging them piecewise makes it much easier to maintain an attention to detail than doing a 'git diff' where everything flows together and 'git commit -a' where you might miss untracked or temporary files.
- wingerlang 10y agoI agree, some time ago I wrote down why I liked GUIs and this was the main point. A relevant part is: This also means that for every commit, you ‘must’ skim through each file and stage only what you want to commit. This serves as a final reminder of your code and has on multiple occasions led me to moments where I had added some temp code which wasn’t supposed to be committed. Full page http://jontelang.com/blog/2016/03/02/committing-with-sourcetree.html http://jontelang.com/blog/2016/03/02/committing-with-sourcet...