Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why git difftool does not open vimdiff in case of conflicts?

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?

like image 403
Vram Vardanian Avatar asked Mar 30 '16 15:03

Vram Vardanian


People also ask

Which command can be used to configure Vimdiff?

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.

How does git Difftool 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.

How do I run git Difftool?

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.


1 Answers

Ok, I found the answer here. git mergetool must be used instead of git difftool in case of conflicts.

like image 82
Vram Vardanian Avatar answered Sep 18 '22 15:09

Vram Vardanian