您的位置:首页 > 产品设计 > UI/UE

git gui diff/merge tool

2011-12-28 11:11 387 查看

Download and Install P4V

Download the free Perforce Visual Client
dmg from here. Once it’s downloaded, copy
p4merge
from the disk image to your
/Applications
directory.

Write some simple shell scripts

p4merge*

Create a new text file in
/usr/local/bin
called
p4merge
and add the following lines:

#!/bin/sh
/Applications/p4merge.app/Contents/MacOS/p4merge $*

Make the script executable by entering this command:

chmod +x p4merge

p4diff*

Create a new text file in
/usr/local/bin
called
p4diff
and add the following lines:

#!/bin/sh
[ $# -eq 7 ] && /usr/local/bin/p4merge "$2" "$5"

Make the script executable by entering this command:

chmod +x p4diff

Configure Git to use the scripts

Open your git configuration file (probably
~/.gitconig
) and add these lines:

[merge]
keepBackup = false;
tool = p4merge
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
[code]prompt = false

keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
external = p4diff[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: