使用 Xcode 4 作为 Git difftool
我想使用 Xcode 4 的“版本编辑器”视图作为 Git 的标准 diff 工具。
换句话说,我希望能够设置此选项:
git config --global diff.external <XCODE>
并在 Xcode 的 diff 查看器中打开 diff(因为它很酷)。
这可能吗?如何?
I want to use Xcode 4's "Version Editor" view as my standard difftool for Git.
In other words, I want to be able to set this option:
git config --global diff.external <XCODE>
And have the diff open in Xcode's diff viewer (because it's cool).
Is this possible? How?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遗憾的是不可能。不过,我们还是希望苹果有一天能够改变这一现状。
我猜您已经知道以下内容,但为了其他可能不知道的人的利益,您可以使用 Apple 的 FileMerge 应用程序来获得类似的(尽管稍微少一些)命令体验,例如:
我的 git 默认使用 FileMerge 作为 difftool ,但你可以显式配置它:(
这也会阻止 git 每次列出候选工具。)我还喜欢禁用 git 的 difftool 预启动提示:
可以配置 git,以便
git diff
也会调用 FileMerge,或者改为调用 FileMerge。 (我更喜欢让git diff
保持原样。)如果您愿意,您首先需要创建一个 shell 脚本来将适当的参数映射到 opendiff:然后运行
Sadly not possible. Here's hoping Apple changes that someday though.
I'm guessing you already know the following, but for the benefit of others who may not, you can use Apple's FileMerge application instead for a similar, albeit somewhat lesser, experience with a command like:
My git defaults to using FileMerge as the difftool, but you can configure it explicitly with:
(This stops git from listing the candidate tools every time too.) I also like to disable git's difftool pre-launch prompting:
It is possible to configure git so that
git diff
will invoke FileMerge as well, or instead. (I prefer to just leavegit diff
the way it is myself.) If you want that you first need to create a shell script to map the appropriate arguments to opendiff:and then run