External git difftool is not working on windows

℡╲_俬逩灬. 提交于 2019-12-10 18:43:38

问题


I'm struggling with git for many ours and have read almost all topics taged by "git", "diff" etc. and tried hundred of different solutions, but did not succeeded at all. I'm trying to set sum external difftool (Meld, p4merge) as my git tool, BUT git ignoring this option at all. Here is my git config --global.

[alias]
    st = status
    co = checkout
    ci = commit
[diff]
    tool = p4merge
[difftool "p4merge"]
    cmd = p4merge.exe $LOCAL $REMOTE
[difftool]
    prompt = false
[merge]
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge.exe $BASE $LOCAL $REMOTE $MERGED
[mergetool]
    prompt = false
    trustExitCode = false
    keepBackup = false

Mergetool command is working perfectly, but difftool is ignored and git starts always build-in diff. What i'm doing wrong?


回答1:


Most likely you're in merge mode (e.g. .git/MERGE_MODE file exists or check by git status), then you cannot use difftool, because the arguments are different, so you've to use mergetool.

If you'd like to abort the merge, run: git merge --abort, then difftool should work.

See also: git difftool runs git diff.



来源:https://stackoverflow.com/questions/30623163/external-git-difftool-is-not-working-on-windows

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