简体   繁体   English

超越比较 - 自动合并工作副本中的“冲突”文件(如果可能)

[英]Beyond Compare - automatically merge “conflicted” files in working copy (if possible)

I have recently merged two branches in Git. 我最近在Git中合并了两个分支。 They were both in development for too long, and hence have a lot of files that were changed on both branches, so Git has marked them as "Conflicted" 它们都处于开发阶段太长时间,因此在两个分支上都有很多文件被更改,因此Git将它们标记为“已冲突”

As soon as I open them in Beyond Compare, there are "no more conflicts" because its smart enough to sort out the supposed conflict. 一旦我在Beyond Compare中打开它们,就会有“没有更多的冲突”,因为它足够智能地解决所谓的冲突。 So its just a matter of open in External Merge Tool (from SourceTree) and then click Save. 因此,只需在外部合并工具(来自SourceTree)中打开,然后单击“保存”即可。 However, there are a lot of files that need this! 但是,有很多文件需要这个! Is there a way of getting Beyond Compare to "batch" process all conflicted files in my working copy? 有没有办法让Beyond Compare“批处理”处理我工作副本中的所有冲突文件?

UPDATE UPDATE

My project's \\.git\\config file specifies the following, which I believed would force Beyond Compare 4 (Pro) to auto-merge the files, but it does not. 我的项目的\\.git\\config文件指定了以下内容,我认为这将迫使Beyond Compare 4(Pro)自动合并文件,但事实并非如此。 Possibly an invalid config? 可能是无效的配置? I have triple checked it :( 我有三重检查:(

[diff]
    tool = bc4
[difftool]
    prompt = false
[difftool "bc4"]
    path = /c/Program Files/Beyond Compare 4/BComp.exe
[merge]
    tool = bc4
[mergetool]
    prompt = false
    keepBackup = false
[mergetool "bc4"]
    cmd = /c/Program Files/Beyond Compare 4/BComp.exe -automerge -ignoreunimportant -reviewconflicts "$LOCAL" "$REMOTE" "$BASE" "$MERGED" 
    trustExitCode = true

如果你有专业版,你可以通过bcompare -automerge开关,如本页所示。

I have Beyond Compare 3 Pro, and this works for me: 我有Beyond Compare 3 Pro,这对我有用:

[mergetool "BeyondCompare3"]
path = C:/Program Files (x86)/Beyond Compare 3/bcomp.exe
cmd = \"C:/Program Files (x86)/Beyond Compare 3/bcomp.exe\" "-automerge -ignoreunimportant -reviewconflicts" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

This will make Beyond compare auto merge, not display the GUI if successful, ignore unimportant differences such as white space. 这将使Beyond比较自动合并,如果成功则不显示GUI,忽略不重要的差异,如空白。 It will only pop up the GUI if a conflict is found. 如果发现冲突,它将仅弹出GUI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM