8

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?

2 Answers 2

9

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

Sign up to request clarification or add additional context in comments.

Comments

1

I don't know as for the why. But to fix it, reset the state of the conflicted file.

git status
    both modified: mymyfile.txt

git difftool myfile.txt #Fails
git reset myfile.txt

git status
    M myfile.txt

git difftool myfile.txt #should work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.