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"
prompt = false
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
external = p4diff

本文将指导您如何下载并安装免费的Perforce视觉客户端,包括安装步骤和创建用于集成到Git中的简单shell脚本。
1173

被折叠的 条评论
为什么被折叠?



