无法获取git使用合并工具

时间:2016-01-08 17:51:51

标签: git

在Windows上。

在我的配置中,我设置了Beyond Compare:

$ git config --list | grep -i bc3
diff.tool=bc3
difftool.bc3.cmd="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE"
difftool.bc3.path="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE"
merge.tool=bc3
mergetool.bc3.cmd="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
mergetool.bc3.path="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

我可以使用该路径从命令行启动Beyond Compare。

但是当git中出现合并冲突时,它没有被使用:

$ git rebase origin/qa
First, rewinding head to replay your work on top of it...
Applying: Krebs up top
Using index info to reconstruct a base tree...
M       file1.txt
.git/rebase-apply/patch:6: trailing whitespace.
Krebbs
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging file1.txt
CONFLICT (content): Merge conflict in file1.txt
error: Failed to merge in the changes.
Patch failed at 0001 Krebs up top
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

我做错了什么?

2 个答案:

答案 0 :(得分:0)

你有没有试过在最后省略参数?此外,似乎只有专业版支持3路合并。

查看Beyond Compare Doc上的说明,建议进行以下设置

  

BC版本3

     

DIFF   在Windows命令提示符下输入命令:

     

git config --global diff.tool bc3

     

git config --global difftool.bc3.path“c:/ Program Files(x86)/ Beyond Compare 3 / bcomp.exe”

     

要使用Beyond Compare启动差异,请使用命令“git difftool foofile.txt”。

     

仅限3-way Merge Pro

     

在Windows命令提示符下,输入命令:

     

git config --global merge.tool bc3

     

git config --global mergetool.bc3.path“c:/ Program Files(x86)/ Beyond Compare 3 / bcomp.exe”

     

要使用Beyond Compare启动3向合并,请使用命令“git mergetool foofile.txt”。

答案 1 :(得分:0)

在Windows命令提示符下输入命令:

git config --global diff.tool bc3

# for version 4
git config --global difftool.bc3.path "c:/Program Files (x86)/Beyond Compare 4/bcomp.exe"

# for version 3
git config --global difftool.bc3.path "c:/Program Files (x86)/Beyond Compare 3/bcomp.exe"

注意
早于2.2.0的Git版本(git --version)使用" bc3"作为BC4的关键字。
对于git 2.2.0+,请使用bc

要使用Beyond Compare启动差异,请使用命令git difftool foofile.txt