Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view the full commit diff in tig when viewing the diff for a single file?

Tags:

git

tig

In the Tig text-mode interface for git, one can view a blame for an individual file and then open a diff view to see that commit that modified that line. e.g.

tig blame file.cpp
(Select a line, press enter.)

However, the diff displayed is limited to the individual file, even if the commit modified multiple files. This is a good default, but is there a way to expand this view to full commit with diff across all files?

The current work around is to copy paste the commit hash, exit, and then use either git or tig to show it.

like image 252
Vincent Scheib Avatar asked Mar 08 '13 23:03

Vincent Scheib


People also ask

How can I see the diff of a commit?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..

Why is git diff not showing?

Why do you get no git diff output before adding? Git does not treat files in the filesystem as automatically included in the version control system. You have to add things explicitly into the Git repository (as you are doing by adding the current directory with git add . ).


1 Answers

Use the toggle-files action. By default it is bound to '%'.

like image 135
Jonas Fonseca Avatar answered Sep 22 '22 02:09

Jonas Fonseca