After reading this, I configured git to use vimdiff as diff/merge tool by adding following lines to my ~/.gitconfig:
[diff]
tool = vimdiff
[merge]
tool = vimdiff
[difftool]
prompt = false
[alias]
d = difftool
But git difftool
still just prints diff (no vimdiff). Any ideas?
UPDATE.
Seems like git difftool
works fine, if I have some uncommitted changes in repo, i.e. it opens vimdiff as expected. But it fails to open vimdiff if I do git difftool
after merge with conflict. Any ideas why?
Vimdiff can be run from the command-line with vimdiff file1 file2 [file3 [file4]] . This actually starts Vim in diff mode -- the previous command is actually equivalent to vim -d file1 file2 [file3 [file4]] . Vim requires a diff command to be available for this to work.
git difftool is a Git command that allows you to compare and edit files between revisions using common diff tools. git difftool is a frontend to git diff and accepts the same options and arguments.
Usage. Run Git Difftool: Diff File from the Command Palette or use ⌥⌃D to diff the currently open file. Run Git Difftool: Diff Project from the Command Palette or use ⌃⇧D to diff the whole project.
Ok, I found the answer here.
git mergetool
must be used instead of git difftool
in case of conflicts.
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