git Phabricator arc land 不起作用,因为功能分支上有多个修订版
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30946733/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Phabricator arc land won't work because that there are multiple revisions on feature branch
提问by lpappone
I have two branches, started at different points. They are mostly the same, except for a few extra commits on one of them. When I try to land that one, I get:
我有两个分支,从不同的点开始。除了对其中之一的一些额外提交之外,它们几乎相同。当我尝试着陆时,我得到:
Usage Exception: There are multiple revisions on feature branch 'newbranch' which are not present on 'devel': -D newbranch1 -D othernew branch
使用例外:功能分支 'newbranch' 上有多个修订版本,但在 'devel' 上不存在:-D newbranch1 -D othernew 分支
Separate these revisions onto different branchs, or use --revision ' to use the commit message from and land them all.
将这些修订分开到不同的分支上,或者使用 --revision ' 来使用来自的提交消息并将它们全部登陆。
I can't find any guidance as to how to separate the revisions onto different branches, or what that even means. Is there any way around this?
我找不到任何关于如何将修订分开到不同分支的指导,或者这意味着什么。有没有办法解决?
回答by CEPA
I recommend to my developers that they need to use --revision
to land the specific change.
我向我的开发人员建议他们需要使用它们--revision
来实现特定的更改。
For example: arc land --revision D123 --onto devel
例如: arc land --revision D123 --onto devel
回答by internetross
While the above answer (https://stackoverflow.com/a/30947476/181344) is correct, if you happen to be in a situation where you interact with Phabricator through commands that abstract on top of arc land
and are not able to pass the --revision
argument directly, know that you also have the option of squashing the commits from different revisions and then attempting to land again.
虽然上面的答案 ( https://stackoverflow.com/a/30947476/181344) 是正确的,但如果您碰巧遇到通过抽象的命令与 Phabricator 交互的情况,arc land
并且无法传递--revision
参数直接,要知道您还可以选择压缩来自不同版本的提交,然后再次尝试登陆。
There is more than one way to accomplish squashing your commits. A couple suggestions are:
有不止一种方法可以完成压缩您的提交。一些建议是:
$ git checkout my-feature-branch && git reset --soft master && git commmit -am 'my new commit message'
Or
或者
$ git rebase -i master