Git使用递归策略和耐心选项进行合并 [英] Git merge using recursive strategy and patience option

查看:728
本文介绍了Git使用递归策略和耐心选项进行合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用递归策略提供的耐心选项将分支与git合并?我使用
git version 1.7.3.1.msysgit.0



即使文档不一致,而且与实际的命令输出有所不同。



文档说:


git merge [-s < strategy> ] [-X < strategy-option> ] < commit>


以及以下文字:


-X <$ c $

$(没有空格)
$ b


$ / $> $ b

命令输出说:

  -X,--strategy-option< option = value> 

选择所选合并策略

所以我尝试了以下几个版本结果:
$ b $ pre $ $ git merge -s递归-Xpatience sourceBranch
致命性:merge-recursive的未知选项:-Xpatience

$ git merge -X耐心sourceBranch
致命错误:合并递归的未知选项:-Xpatience

$ git merge -Xpatience sourceBranch
致命错误:未知的merge-recursive选项:-Xpatience

$ git merge --strategy-option耐心sourceBranch
致命:合并递归的未知选项:-Xpatience

$ git merge -X option =耐心sourceBranch
致命:合并递归的未知选项:-Xoption =耐心

$ git merge --strategy-option option =耐心sourceBranch
致命:合并递归的未知选项:-Xoption =耐心

$ git合并选项=耐心sourceBranch
致命:'option = patience'不指向提交

$ git merge -X o ption =耐心sourceBranch
致命:合并递归的未知选项:-Xoption =耐心

它看起来好像该选项没有实现...

解决方案

- 耐心 <$>中引入了 git merge-recursive 的$ c>选项C $ C> 58a1ece478c6038a7eb0b6e494d563bd5e6d5978 。您可以在 git.git 的克隆中找到哪些版本包含此更改( git tag --contains 58a1ece478

  v1.7.4 
v1.7.4-rc0
v1.7.4-rc1
v1 .7.4-rc2
v1.7.4-rc3
v1.7.4.1

所以我怀疑你只是使用了稍微老一点的mSysGit版本。现在有一个1.7.4的预览版 - 我认为你应该尝试一下。



我刚刚在git 1.7.4版本中试过,以下命令行语法适用于我:

  git merge -s递归-X耐心其他分支


How to merge a branch with git using patience option provided by the recursive strategy? I'm using git version 1.7.3.1.msysgit.0

Even docs are not consistent and, what's more, differ from what the actual command outputs.

Docs say:

git merge [-s <strategy>] [-X <strategy-option>] <commit>

and further in text:

-X<option>

(no space)

Output from the command says:

-X, --strategy-option <option=value>

option for selected merge strategy

So I tried a couple versions with following results:

$ git merge -s recursive -Xpatience sourceBranch
fatal: Unknown option for merge-recursive: -Xpatience

$ git merge -X patience sourceBranch
fatal: Unknown option for merge-recursive: -Xpatience

$ git merge -Xpatience sourceBranch
fatal: Unknown option for merge-recursive: -Xpatience

$ git merge --strategy-option patience sourceBranch
fatal: Unknown option for merge-recursive: -Xpatience

$ git merge -X option=patience sourceBranch
fatal: Unknown option for merge-recursive: -Xoption=patience

$ git merge --strategy-option option=patience sourceBranch
fatal: Unknown option for merge-recursive: -Xoption=patience

$ git merge option=patience sourceBranch
fatal: 'option=patience' does not point to a commit

$ git merge -X option=patience sourceBranch
fatal: Unknown option for merge-recursive: -Xoption=patience

It looks as if the option's not implemented...

解决方案

The --patience option for git merge-recursive was introduced in commit 58a1ece478c6038a7eb0b6e494d563bd5e6d5978. You can find out in a clone of git.git what versions contain this change with git tag --contains 58a1ece478:

v1.7.4
v1.7.4-rc0
v1.7.4-rc1
v1.7.4-rc2
v1.7.4-rc3
v1.7.4.1

So I suspect that you're just using a slightly too old version of mSysGit. There is a preview version of 1.7.4 available now - I think you should try that one.

I've just tried this with git version 1.7.4, and the following command line syntax works for me:

git merge -s recursive -X patience other-branch

这篇关于Git使用递归策略和耐心选项进行合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆