Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diff of current and previous version using vim-fugitive

Tags:

I know that :Glog will populate the quickfix list with all the versions of the file in the current buffer and that I can hit <enter> on these to see the file at that particular version, but is there an easy way to see the diff of a particular version with the previous version (to easily see what has changed)?

EDIT: What I'm after is seeing each of these changes in a vertical diff in vim: git log -p -- path/to/file.txt.

like image 766
zoran119 Avatar asked May 28 '13 22:05

zoran119


Video Answer


1 Answers

This is what I use:

:Gdiff [revision] 

See :help Gdiff for other options as well (vertical vs horizontal splits, etc).

For example:

:Gdiff HEAD 

or if you have a revision number (ie: aaffdfdstsdgssetds):

:Gdiff aaffdfds 
like image 192
David Avatar answered Nov 27 '22 07:11

David