0

最初执行了如何解决 Git 中的合并冲突中提到的命令

我做了:

git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false

然后我做了提到的命令How to use opendiff as default mergetool

我做了两个:

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
git config --global merge.tool opendiff

我还检查了它:

$ git config --global merge.tool

终端说是opendiff

但是,当我执行 git 时mergetool,它会恢复为使用vimdiff.

如果我尝试链接答案中的第二个解决方案,即:

$ git mergetool -t opendiff

然后它工作一次。

那么我如何才能将其永久更改为opendiff

4

1 回答 1

1
git config merge.tool vimdiff

这将 Git 配置为仅对该存储库使用 vimdiff 。

git config --global merge.tool opendiff

这会将 Git 配置为对所有没有更具体配置的存储库使用 opendiff ,即除了您之前配置的存储库之外的所有存储库。

git config --global merge.tool

这会问 Git:如果我不在存储库或任何其他具有覆盖集的存储库中,您会使用什么工具?

要使 Git 使用默认值,请删除本地覆盖:

git config --unset merge.tool

(注:否--global)。

于 2019-03-08T22:34:56.260 回答