您好我想使用了opendiff作为git的合并工具,但是当我运行合并工具我收到此错误信息:如何使用了opendiff作为默认的合并工具
合并工具了opendiff不作为“了opendiff”
我在做什么错?这是工作的罚款过,但因为我安装了一个新的硬盘它不工作了:(
您好我想使用了opendiff作为git的合并工具,但是当我运行合并工具我收到此错误信息:如何使用了opendiff作为默认的合并工具
合并工具了opendiff不作为“了opendiff”
我在做什么错?这是工作的罚款过,但因为我安装了一个新的硬盘它不工作了:(
确保你已经安装了XCode。(如果你使用Git,那么你可能使用BREW,在这种情况下,你可能已经拥有了XCode 。安装)
一次性的解决方法是告诉你要使用git什么工具:
$ git mergetool -t opendiff
至于设立了opendiff为默认工具,你需要设置“merge.tool “变量在你的git配置文件中。
jeetworks链接已经死了 –
thx,Brian。答案已经更新。 – cogell
你需要到了opendiff配置为全局merge.tool:
# locate xcode utilities
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# set "opendiff" as the default mergetool globally
git config --global merge.tool opendiff
如果你Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo
,打开Xcode和接受许可修复该问题
何时需要'xcode-select'命令? –
我想'git'还没有找到,但很难理解你在这种情况下会如何结束。 – Tommy
混帐支持--dir-DIFF(-d)执行目录diff,在FileMerge中看起来不错。但是,使用opendiff和--dir-diff有一些小问题。 opendiff没有--merge目标预设,git会尽快删除临时文件以保存更改。我的解决方法是使用一个小小的bash脚本来调用FileMerge。我叫它gdiff
。
#!/bin/bash
# find top level of git project
dir=$PWD
until [ -e "$dir/.git" ]; do
if [ "$dir" == "/" ]; then
echo "Not a git repository" >&2
exit 1;
fi
dir=`dirname "$dir"`
done
# open fresh FileMerge and wait for termination
open -a FileMerge -n -W --args -left "$1" -right "$2" -merge "$dir"
https://gist.github.com/miner/e73fc98a83a8fe05d9ef000d46d68a9f
这样称呼它:
git difftool -d -x gdiff
什么操作系统您使用的? – Ikke
这是在OSX Snow Leopard上。 – CorpusCallosum
清洁opendiff并重新安装?我希望你已经试过了 – Ram