是否可以在Mac上使用GUI并行工具查看git diff? [英] Is it possible to view git diffs using a GUI side-by-side tool on Mac?
问题描述
我真的很讨厌使用默认的UNIX diff
工具来显示差异。是否有可能使用GUI工具来查看git diffs,该工具将很好地显示本地和远程并行,类似于如何将 mergetool
设置为 DiffMerge
并且当你做时
git mergetool myfile.txt
它会弹出DiffMerge GUI,以便更方便地进行可视化和合并?我使用的是OSX。
您可以使用 opendiff
。它是一个命令行工具,可打开 FileMerge 的图形用户界面。
您可以指示Git自动为 git-mergetool
使用它:
git config --global merge.tool opendiff
如果你希望它为 git-difftool
以及:
git config - global diff.tool opendiff
您也可以禁用每个文件的提示:
git config --global difftool.prompt false
有关更多详细信息,请键入: git help config
并使用 /
为不同的选项。
PS如果您没有安装 opendiff
,您可以将它与XCode中的开发人员工具一起安装: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/opendiff。 1.html
$ b 更新:在最新版本的XCode中,FileMerge现在与XCode捆绑在一起。您不能将FileMerge安装为独立程序。
opendiff
仍然在其独立的命令行工具中。 I really hate visualizing diffs using the default UNIX diff
tool. Is it possible to do view git diffs using a GUI tool that will nicely display the local and remote side-by-side, similar how it is possible to set the mergetool
to be DiffMerge
and when you do
git mergetool myfile.txt
it pops the DiffMerge GUI for easier visualization and merging? I am using OSX.
You could use opendiff
. It is a command line tool which opens the GUI of FileMerge.
You could instruct Git to use it automatically for git-mergetool
with:
git config --global merge.tool opendiff
If you want it for git-difftool
as well:
git config --global diff.tool opendiff
And you could also disable the prompting for every file with:
git config --global difftool.prompt false
For more details type: git help config
and search with /
for the different options.
P.S. If you don't have opendiff
installed you could install it together with the Developer Tools from XCode: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/opendiff.1.html
UPDATE: In recent versions of XCode, FileMerge is now bundled with XCode. You cannot install FileMerge as a standalone program. opendiff
is still in its command-line utilities which are standalone.
这篇关于是否可以在Mac上使用GUI并行工具查看git diff?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!