1.安装P4merge http://www.perforce.com/perforce/products/merge.html
将安装路径加入到PATH变量中
2. 打开.gitcofig文件,添加如下内容
[diff]
tool = p4merge
[difftool "p4merge"]
external = "p4merge $LOCAL $REMOTE"
prompt = false
[merge]
tool = p4merge
[mergetool "p4merge"]
cmd = "p4merge $BASE $LOCAL $REMOTE $MERGED"
prompt = false
keepTemporaries = false
trustExitCode = true
keepBackup = false
3. 运行git difftool打开图形界面
参考:http://stackoverflow.com/questions/7944757/configuring-a-diff-tool-for-git-on-windows
http://www.geekgumbo.com/2010/05/12/installing-and-using-p4merge-in-git-for-windows/
Linux平台推荐
- gitk - graphical history browser, in Tcl/Tk, distributed with Git (usually in
gitk
package) - git gui - graphical commit tool, in Tcl/Tk, distributed with Git (usually in
git-gui
package) - QGit - uses Qt toolkit
- Giggle - uses GTK+ toolkit
- git-cola - uses PyQt4
- gitg - GTK+/GNOME clone of GitX
- tig - text mode interface for git, is GUI and pager, uses ncurses
http://stackoverflow.com/questions/1516720/git-gui-client-for-linux