2 ms·
git add -p It will let you approve each hunk in a file to commit or not. git commit -e -v Will force you to edit the commit message and in the editor show yo
by jimktrains2 9y ago
git add -p
It will let you approve each hunk in a file to commit or not.
git commit -e -v
Will force you to edit the commit message and in the editor show you the diff of the commit against HEAD.
- Drdrdrq 9y agoThank you! I use 'git add -p' all the time, but didn't know the trick with commit. I am a sucker for nice commits so I will check every commit's diff multiple times. When I don't, I usually end up including pieces of code which is not ready yet, which is meant for debugging,...