vim-fugitive side-by-side git diff is great for viewing diff of unstaged files.
How can I use vim-fugitive to git diff
To see the diff for a particular COMMIT hash, where COMMIT is the hash of the commit: git diff COMMIT~ COMMIT will show you the difference between that COMMIT 's ancestor and the COMMIT .
The diff can be done with git diff (followed by the filename or nothing if you want to see the diff of all modified files). But if you already did something like git add * , you have to undo with git restore --staged .
The git diff command allows us to compare different versions of branches and repository. To get the difference between branches, run the git diff command as follows: $ git diff <branch 1> < branch 2>
Diff between current file and the index
:Gdiff :0
Diff between current file and some other [revision]
:Gdiff [revision]
Diff between current file and current file 3 commits ago:
:Gdiff ~3
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