[英]Using git with diffmerge with no prompts and no alias
On OSX, I'm using diffmerge as my git diffing tool. 在OSX上,我使用diffmerge作为我的git diffing工具。 Here is my .gitconfig: 这是我的.gitconfig:
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[alias]
d = difftool --no-prompt
If I just use git difftool
it will prompt me for every single file I want to diff. 如果我只是使用git difftool
它会提示我输入我想要的每个文件。 To get around this, I created the git d
alias and added the --no-prompt flag. 为了解决这个问题,我创建了git d
别名并添加了--no-prompt标志。
Is there any way I can prevent the repeated prompts without having the alias? 有没有办法可以防止重复提示没有别名? I tried inserting prompt=false
and prompt = NO
under difftool, as well as moving the --no-prompt flag next to the diffmerge command, but none of these helped. 我尝试在difftool下插入prompt=false
和prompt = NO
,以及在diffmerge命令旁移动--no-prompt标志,但这些都没有帮助。
moving the
--no-prompt
flag next to thediffmerge
command 移动diffmerge
命令旁边的--no-prompt
标志
--no-prompt
is an argument of difftool
(as I mention in " How do I view 'git diff' output with a visual diff program? "). --no-prompt
是difftool
一个参数(正如我在“ 如何通过可视差异程序查看'git diff'输出中提到的那样? ”)。
So I confirm it won't work with diffmerge
. 所以我确认它不适用于diffmerge
。
I tried inserting
prompt=false
andprompt = NO
underdifftool
我尝试在difftool
下插入prompt=false
和prompt = NO
under a [difftool]
section directly, that should work (not under [difftool "diffmerge"]
) 直接在[difftool]
部分下,应该工作(不在[difftool "diffmerge"]
)
You can see another approach here , based on wrappers: that can help to debug those commands. 您可以在此处看到基于包装器的另一种方法 :可以帮助调试这些命令。
git config --global difftool.diffmerge.cmd "diffmerge-diff.sh \"\$LOCAL\" \"\$REMOTE\"" \"\$BASE\"" \"\$MERGED\""
git config --global difftool.prompt false
git config --global diff.tool diffmerge
git difftool
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.