【问题标题】:How can I successfully change my default mergetool utility to opendiff如何成功地将我的默认合并工具实用程序更改为 opendiff
【发布时间】:2019-07-30 22:49:57
【问题描述】:

最初做了How to resolve merge conflicts in 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

【问题讨论】:

  • 验证userprofile目录下的.gitconfig文件
  • 我应该验证什么?
  • [diff] 工具 = opendiff
  • 设置为opendiff
  • 你能看到我的编辑吗?

标签: xcode git mergetool opendiff


【解决方案1】:
git config merge.tool vimdiff

这会将 Git 配置为使用 vimdiff 仅用于此存储库

git config --global merge.tool opendiff

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

git config --global merge.tool

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

要让 Git 使用默认值,移除本地覆盖:

git config --unset merge.tool

(注意:没有--global)。

【讨论】:

  • 哈!我刚刚做了git config merge.tool(没有--global),它返回了vimdiff。这只是帮助我更好地理解--global选项。谢谢
  • 对,那会问 Git:您应该为 this 存储库使用什么工具? 当然,哪个是您的覆盖设置。
猜你喜欢
  • 2012-11-23
  • 2012-05-06
  • 1970-01-01
  • 1970-01-01
  • 2019-07-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多