Git difftool not opening sometimes

我只是一个虾纸丫 提交于 2019-12-10 23:59:47

问题


I have 2 folders (with different code) with git initialized. But when I do

git difftool -t meld 

one repo is working fine and asking me if I want to open files in meld to compare. The other one just output everything in the console and didn't execute meld.

Also both .git/config file is the same (except for the url)

Does anyone know why is that?


回答1:


If in one repository you're in conflicted state (check by git status), you need to use mergetool instead, e.g.

git mergetool -t meld

Related: git difftool runs git diff.




回答2:


You may have configured your diff.tool locally instead of globally (inspect the content of .git/config files in both your porjects, and your global ~/.gitconfig file).

To set meld as your global difftool :

git config --global diff.tool meld



回答3:


Is it possible you have configured difftool, but not mergetool, and had a conflict outstanding?

I found similar behaviour, when I had an existing conflict that needed resolving. I think what happened to me was that git was trying to be 'helpful' and launch mergetool when I asked for difftool. I had not set up any mergetool, only difftool. When I manually resolved the conflict with git add, difftool started working again. Very frustrating.



来源:https://stackoverflow.com/questions/35642530/git-difftool-not-opening-sometimes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!