git mac 可视化diff_是否可以在Mac上使用GUI并行工具查看git diff?

bd96500e110b49cbb3cd949968f18be7.png

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值