gpt4 book ai didi

git - 如何让 git 使用 vimdiff 和 trustExitCode

转载 作者:太空狗 更新时间:2023-10-29 13:31:04 24 4
gpt4 key购买 nike

我已经将 vimdiff 配置为 git 的 mergetool。每当我进行 merge 时,git 从不询问 merge 是否成功。我也试过:

git config --global mergetool.vimdiff.trustExitCode false

没有区别。在我用 :wqa 离开 vimdiff 之后仍然没有问题,我必须手动删除陈旧的 *.orig 文件。

可能相关:当我显示配置设置时 trustExitCode 不再显示驼峰式:

git config --global -l

core.editor=vim
core.autocrlf=input
merge.tool=vimdiff
alias.co=checkout
alias.st=status
color.diff=auto
color.status=auto
color.branch=auto
mergetool.vimdiff.trustexitcode=false

如何解决这个问题?

最佳答案

我知道这是一个老问题,但我刚刚遇到了同样的问题。

关于手动删除陈旧备份文件的部分可以通过以下方式修复:

git config --global mergetool.vimdiff.keepBackup false

我认为另一个问题是 trustExitCode不做你认为它做的事:

mergetool.<tool>.trustExitCode

For a custom merge command, specify whether the exit code of the merge command can be used to determine whether the merge was successful. If this is not set to true then the merge target file timestamp is checked and the merge assumed to have been successful if the file has been updated, otherwise the user is prompted to indicate the success of the merge.

因此,即使将此选项设置为 false,它也只会在文件未更改时提示您。

关于git - 如何让 git 使用 vimdiff 和 trustExitCode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6174266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com