Step through a file's history in git; similar to p4v timelapse

I'm seeking a tool to help when probing a file's history. Specifically, I want to view the entire contents of the file, but be able to step backward and forward in time. Extra joy for decorations indicating the diff from previous rev or some other specified rev.

Currently I use git blame, and can see what changes impacted each current line. Then I have to relaunch a viewer for that file with some particular commit. It's labor intensive, and if a tool already automates this I'd love to use it!

Perforce's timelapse view is the best tool to date I've seen for this task.


Solution 1:

gitk -- filename should do what you want, if you kick up the lines of context in the middle, and scroll up and down through the revisions.

Solution 2:

Tig, a text mode interface for git, offers a blame view that offers some of this functionality:

  • Step backwards in time to the commit of a given line (b key).
  • Step backwards to the parent commit of a given line (, key).
  • Returning forwards in time to a view you were at previously (< key).

It does not preserve the viewing location when stepping to a parent commit (it seems to when using the line's commit).