Git Tip of the Day – see changes while committing

The series continues! 🙂

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.

Happy gitting!


Flattr this

One thought on “Git Tip of the Day – see changes while committing

Leave a Reply (Markdown syntax supported)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s