Search code examples
tig

How do I look at a file across revisions?


I'm familiar with using https://github.com/jonas/tig to view my changes, but often I want to see the whole file and quickly run through the changes. I think this "git timemachine" feature doesn't exist in tig judging my these bug reports:

My workaround is the use tig blame $filename and hit f to look at the blob at that revision, which is super awkward since different lines change at different times.

What am I missing?


Solution

  • Maybe this binding:

    bind generic V !sh -c 'git show $1:$2' -- %(commit) %(fileargs)
    

    then run something like tig -- README.adoc. Select a commit and hit "V" to view the file.