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.
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 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 . ).
Use the toggle-files action. By default it is bound to '%'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With