You’ve surely seen this scenario:
You have just prepared the patch and you want to commit it. But when you run:
$ git commit
and you want to describe the changes, you are not sure whether you remember all of them. So you must fire up another terminal, display the diff and ensure the commit message covers all the major points.
But there’s a nice solution:
$ git commit -v
This will display the diff inside the commit message editor, so you can go through all the changes in the same window in which you’re describing them. I find it very convenient.
Some of you may probably even want to create an alias for it:
$ git config --global alias.ci 'commit -v' $ git ci
Oh, so nice.
One thought on “Git Tip of the Day – see changes while committing”
Cool, I’ll have to try commit -v.