Search code examples
gittig

How do I use tig to view the diff for a file which is changed but not commited?


In git, it is git diff <file path>, but what about in tig?

In tig, in the status view, highlighting a file (staged or unstaged) and pressing D, diffs the last commit. I think it should diff the uncommitted file against the last committed version of that file.


Solution

  • As a hack, you can do git diff <file path> | tig and see it.

    On the status section in tig you can see both the staged and unstaged changes (say, git diff vs git diff --cached) pressing Enter over the file in each of the sections it appears (under "Changes to be committed" or "Changed but not updated").

    It may be a nice feature to just tig diff -- <file path> but, well - go ahead, code it :)