use fugitive to diff branches or commits
To diff one file with fugitive is quite easy, just use command:
Gvdiff HEAD^
to diff with HEAD^Gvdiff 0d39a336b9511af255544fd176816f4a21c199e5
to diff with specific commit
To diff all files between branches or commits is kind of obscure, it took me some time to figure out. Mark down here, hope that it helps others who are using fugitive.
-
open a total git diff with command
Gtabedit 0d39a336b9511af255544fd176816f4a21c199e5
(replace0d39a336b9511af255544fd176816f4a21c199e5
with the branch or the commit id you’d like to diff against). The total diff window is opened as below. -
jump to a folded line for some file(such as line 8 in above screenshot), press
O
to open diff for that file in a new tab.