Show history of a file? [duplicate]
Possible Duplicate:
View the change history of a file using Git versioning
Sometimes I want to step through the history of a particular file. In the past I used P4V and this was very quick and intuitive.
- Right click on a file and select history.
- Scrolling through the dates and see a nice diff of exactly what changed in that file on that date. Simple.
Switching to git this is now a grueling task.
- "git log filename"
- Look at history and pick a date, copy hash
- "git diff hash"
- Scroll through diff for the stuff that changed in the file I am interested in.
- Nope, that's not it, lets try a different date - back to step 2, rinse and repeat.
I've searched SO, and I've tried a few of the commonly suggested guis: github, gitk, gitg, git-gui.
These all remove the need to manually run commands, but the workflow is the same for this. View history of file; view commit; search through diff of lots of irrelevant files. It's slow and repetitive.
All the data is in the repo so I see no reason this simple common use case could not be more streamlined.
Can anyone recommend a tool that does this - or a more efficient way to utilize the command line to do what I want?
Thanks for any suggestions.
Solution 1:
You can use git log to display the diffs while searching:
git log -p -- path/to/file
Solution 2:
Have you tried this:
gitk path/to/file