git 在 windows上自定义比较、合并工具(Beyond Compare)
2011-03-22 20:40
387 查看
文章分类:软件开发管理
在windows上就选Beyond Compare来作比较和合并工具吧。
Beyond Compare官方给出来多个版本工具的配置方案。
http://www.scootersoftware.com/support.php?c=kb_vcs.php
Git for Windows
Note: If you use the Git for Windows' Bash Command Prompt instead of the default Windows Command Prompt, you need to escape the $ character with */$*.
Diff
At a command prompt enter the commands:
git config --global diff.tool bc3
git config --global difftool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/""
git config --global difftool.prompt false
To launch a diff with BC3, use the command "git difftool foofile.txt".
3-Way Merge (v3 Pro)
At a command prompt, enter the commands:
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/""
git config --global mergetool.bc3.trustExitCode true
To launch a 3-way merge with BC3, use the command "git mergetool foofile.txt".
需要注意的是在配置
git config --global difftool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/""
和
git config --global mergetool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/""
这个的时候会丢失 $引用的变量,所以最好还是检查一下配置文件的配置是否正确。
我的配置文件:
[user]
name = liujiuwu
email = liujiuwu@gmail.com
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
rb = svn rebase
ci = commit -a
co = checkout
[diff]
tool = bc3
[difftool "bc3"]
cmd = /"c:/program files/Beyond Compare 3/BComp.exe/" /"$LOCAL/" /"$REMOTE/"
[difftool]
prompt = false
[merge]
tool = bc3
[mergetool "bc3"]
cmd = /"c:/program files/Beyond Compare 3/BComp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/"
trustExitCode = true
同理, Ubuntu上的配置如下所示,只需要把bcompare放到PATH的环境变量中:
[diff]
tool = bc3
[difftool "bc3"]
cmd = /"bcompare/" /"$LOCAL/" /"$REMOTE/"
在windows上就选Beyond Compare来作比较和合并工具吧。
Beyond Compare官方给出来多个版本工具的配置方案。
http://www.scootersoftware.com/support.php?c=kb_vcs.php
Git for Windows
Note: If you use the Git for Windows' Bash Command Prompt instead of the default Windows Command Prompt, you need to escape the $ character with */$*.
Diff
At a command prompt enter the commands:
git config --global diff.tool bc3
git config --global difftool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/""
git config --global difftool.prompt false
To launch a diff with BC3, use the command "git difftool foofile.txt".
3-Way Merge (v3 Pro)
At a command prompt, enter the commands:
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/""
git config --global mergetool.bc3.trustExitCode true
To launch a 3-way merge with BC3, use the command "git mergetool foofile.txt".
需要注意的是在配置
git config --global difftool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/""
和
git config --global mergetool.bc3.cmd "/"c:/program files/beyond compare 3/bcomp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/""
这个的时候会丢失 $引用的变量,所以最好还是检查一下配置文件的配置是否正确。
我的配置文件:
[user]
name = liujiuwu
email = liujiuwu@gmail.com
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
rb = svn rebase
ci = commit -a
co = checkout
[diff]
tool = bc3
[difftool "bc3"]
cmd = /"c:/program files/Beyond Compare 3/BComp.exe/" /"$LOCAL/" /"$REMOTE/"
[difftool]
prompt = false
[merge]
tool = bc3
[mergetool "bc3"]
cmd = /"c:/program files/Beyond Compare 3/BComp.exe/" /"$LOCAL/" /"$REMOTE/" /"$BASE/" /"$MERGED/"
trustExitCode = true
同理, Ubuntu上的配置如下所示,只需要把bcompare放到PATH的环境变量中:
[diff]
tool = bc3
[difftool "bc3"]
cmd = /"bcompare/" /"$LOCAL/" /"$REMOTE/"
相关文章推荐
- Windows下使用Beyond Compare作为git的比对与合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Windows平台下使用Beyond Compare作为GIT默认的比对与合并工具
- Windows下使用Beyond Compare作为git的比对与合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Windows下使用Beyond Compare作为git的比对与合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Git下使用Beyond Compare作为比较和合并工具
- Git 集成 Araxis Merge 作为比较和合并GUI工具的配置
- MAC 上git集成比较diff工具和merge合并工具的使用
- Windows下设置git对比和合入工具为beyond compare
- Git使用Beyond Compare作为比对合并工具
- win与linux下git配置p4merge为合并比较工具的方法【转】
- git辅助神器:修改默认文本比较工具diff 为Beyond Compare
- Beyond Compare作为git的比对与合并工具
- 设置Beyond Compare 为 Git 默认的比较工具
- Git小技巧 - 指令别名及使用Beyond Compare作为差异比较工具
- 配置Beyond Compare作为比较和合并工具