Ubuntu config p4merge for git
Download and install p4merge
Download address:http://www.perforce.com/perforce/products/merge.html
unzip the package : $tar -xvf p4v.tar
copy the bin and lib folder to "/usr" dir using admim (sudo)
解压得到两个文件夹bin和lib,将这两个文件夹覆盖到/usr 目录(使用管理员权限)
2.
$ sudo vim /usr/local/bin/extDiff
#!/bin/bash
/usr/bin/p4merge "$2" "$5"
- $ sudo vim /usr/local/bin/extMerge
- #!/bin/sh
- /usr/bin/p4merge $*
$ sudo chmod +x /usr/local/bin/extDiff
$ sudo chmod +x /usr/local/bin/extMerge
3.Edit ~/.gitconfig:add the following command:
- [diff]
- external = extDiff
- [gui]
- spellingdictionary = none
- [mergetool]
- trustExitCode = false
- [merge]
- tool = p4merge
- [mergetool "p4merge"]
- cmd = p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"