Re:Show HN: Git Confirm. Git hook to catch accidentally comm...
by wingerlang on Thursday August 04, 2016 @12:37AM
(#12223415)
I 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-sourcet...
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.