简体   繁体   English

外部git difftool无法在Windows上运行

[英]External git difftool is not working on windows

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. 我正在努力与我们的许多人一起使用git并阅读几乎所有的主题由“git”,“diff”等等,并尝试了数百种不同的解决方案,但根本没有成功。 I'm trying to set sum external difftool (Meld, p4merge) as my git tool, BUT git ignoring this option at all. 我正在尝试设置sum外部difftool(Meld,p4merge)作为我的git工具,但是Git完全忽略了这个选项。 Here is my git config --global . 这是我的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. Mergetool命令工作正常,但是difftool被忽略,git开始总是内置diff。 What i'm doing wrong? 我做错了什么?

Most likely you're in merge mode (eg .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 . 很可能你处于合并模式(例如.git/MERGE_MODE文件存在或通过git status检查),那么你不能使用difftool ,因为参数不同,所以你要使用mergetool

If you'd like to abort the merge, run: git merge --abort , then difftool should work. 如果您想中止合并,请运行: git merge --abort ,然后difftool应该可以工作。

See also: git difftool runs git diff . 另请参阅: git difftool运行git diff

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM