在Ubuntu 12.04下配置diff merge 工具 SourceGear DiffMerge

首先官网下载http://www.sourcegear.com/diffmerge/,直接安装即可 

然后在console里面执行: 

Shell代码  收藏代码
  1. git config --global diff.tool diffmerge  
  2. git config --global difftool.diffmerge.cmd 'diffmerge "$LOCAL" "$REMOTE"'  
  3. git config --global merge.tool diffmerge  
  4. git config --global mergetool.diffmerge.cmd 'diffmerge --merge --result="$MERGED" "$LOCAL" "$(if test -f "$BASE"; then echo "$BASE"; else echo "$LOCAL"; fi)" "$REMOTE"'  
  5. git config --global mergetool.diffmerge.trustExitCode true  



执行成功后能使用git 来diff了 

Shell代码  收藏代码
  1. # diff the local file.m against the checked-in version  
  2. git difftool file.m  
  3.   
  4. # diff the local file.m against the version in some-feature-branch  
  5. git difftool some-feature-branch file.m  
  6.   
  7. # diff the file.m from the Build-54 tag to the Build-55 tag  
  8. git difftool Build-54..Build-55 file.m  



Merge也ok: 

Java代码  收藏代码
    1. git mergetool  

posted on 2013-11-01 23:49  一个石头  阅读(737)  评论(0)    收藏  举报