View the change history of a file using Git versioning

Richard picture Richard · Nov 10, 2008 · Viewed 1.8M times · Source

How can I view the change history of an individual file in Git, complete details with what has changed?

I have got as far as:

git log -- [filename]

which shows me the commit history of the file, but how do I get at the content of each of the file changes?

I'm trying to make the transition from MS SourceSafe and that used to be a simple right-clickshow history.

Answer

Claudio Acciaresi picture Claudio Acciaresi · Aug 24, 2009

For this I'd use:

gitk [filename]

or to follow filename past renames

gitk --follow [filename]