git - 将 git 的运行 merge 移动到无法比拟的位置

标签 git git-merge beyondcompare3

我在本地分支机构中进行了某些更改。我没有 promise 。我只是将所有更改编入索引并将它们移动到 stash。 现在我做了一个

git pull

在 git pull 之后我做了

git stash apply

现在有一些冲突。在 Eclipse 中,我可以看到正常 git 格式的冲突

<<<< Updated Upstream
ksldjflsdk
sdlkfjdslk
sdlkfjsdlk
===========
sdlkfjdslk
dslkfjdslkfj
dsklfjsdlkjf
>>>>> Stashed Changes

现在有些文件有很多冲突。我很难上下查找和 merge 。有什么方法可以让当前的 merge 过程变得无与伦比。

我使用的是 git 版本 1.8.3 和 Beyond Compare 3.2.3

最佳答案

我假设您可以从命令行启动 Beyond Compare,并且您使用的是 Windows。您可以将以下行添加到全局 .gitconfig 文件中:

[merge]
    tool = bc3
[diff]
    tool = bc3
[difftool "bc3"]
    cmd = "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""
[mergetool "bc3"]
    cmd = "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""

编辑:添加 Mac 命令 straight from site :

git config --global diff.tool bc3
git config --global merge.tool bc3
git config --global mergetool.bc3.trustExitCode true

然后您可以简单地使用以下命令开始冲突解决:

git mergetool # Starts Beyond Compare for all conflicted files, one at a time.
git mergetool -- <file> # Starts B.C. just for the specified file.

关于git - 将 git 的运行 merge 移动到无法比拟的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22246907/

相关文章:

xml - BeyondCompare 比较 XML 文件 - 在文件夹比较期间忽略特定元素

mercurial - 使用 Beyond Compare (Mercurial) 解决 merge 冲突

git - 由于未 merge 的文件,无法更改分支或提交。无法 merge 或 stash 文件,因为我在错误的分支中

git - 检查分支是否已经 merge 到远程的 master 或 dev 分支中

git - 如何从 Github 上已关闭的 pull 请求中删除/替换提交

Git:远程拒绝,无法将对象迁移到永久存储

Git merge 和未暂存的文件

beyondcompare3 - Beyond Compare 忽略所有文件中不重要的差异

git - 在不归档的情况下将 Git SHA1 信息扩展到 checkin 中?

git - 使用 Git,如何关闭 "LF will be replaced by CRLF"警告