你如何让git diff在OS X上使用gitx --diff [英] How do you make git diff use gitx --diff on OS X

查看:102
本文介绍了你如何让git diff在OS X上使用gitx --diff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gitx有一个很好的差异查看器,我怎么让git自动管道git diff 什么到gitx?



我试过将git config diff.external设置为如下所示的shell脚本:

  git diff$ 2$ 5 gitx 

然而,这只会将所有单个文件打开成多个gitx窗口,文件名(将它们全部更改为具有疯狂名称的tmp文件)。



有没有人有更好的解决方案?

像sigjuice在那里说。只有noobs(比如我现在)需要知道如何连接git才能使用它。这是我所做的

  echo'opendiff $ 2 $ 5'> 〜/ opendiff-git.sh 
chmod a + x〜/ opendiff-git.sh
git config --global diff.external〜/ opendiff-git.sh

现在所有的git diff whatever都应该打开FileMerge.app ...

Gitx has a great diff viewer, how do I make git automatically pipe git diff whatever into gitx?

I've tried to set git config diff.external to a shell script that looks like this:

git diff "$2" "$5" | gitx

However, that only opens all the individual files up into multiple gitx windows, and it really messes up the files names (changes them all to tmp files with crazy names).

Does anyone have a better solution?

解决方案

like sigjuice is saying up there. Only that noobs (like i am now) need to know how to "connect" git to use it. Here is what I did

echo 'opendiff $2 $5' > ~/opendiff-git.sh
chmod a+x ~/opendiff-git.sh
git config --global diff.external ~/opendiff-git.sh 

and now all "git diff whatever" should open FileMerge.app ...

这篇关于你如何让git diff在OS X上使用gitx --diff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆