将推送的命名分支与默认分支合并会导致错误
我使用 Mercurial Eclipse 插件 20111225_Content_Build
创建了一个命名分支,在本地提交此分支后,我将其推送到我的 bitbucket 存储库,而没有先与 default
合并。现在我有了默认分支(非活动)和我的命名分支 20111225_Content_Build
(活动)。我尝试按照以下步骤合并这两个:
hg update default
这给了我一个错误:abort:工作目录中未跟踪的文件与请求修订中的文件不同:'target/m2e-wtp/web-resources/META-INF/maven/ org.bixin.dugsi/Dugsi_Manager/pom.xml'
然后当我尝试合并时: hg merge 20111225_Content_Build
我收到一条错误,指出我无法与工作目录合并?
abort: merging with a working directory ancestor has no effect
我确实有几个生成的 target/
文件尚未提交或推送,我是否需要推送这些文件才能合并这两个分支?
I created a named branch using the mercurial eclipse plugin 20111225_Content_Build
and after committing this branch locally, i pushed to my bitbucket repository without first merging with default
. Now i have the default (inactive) and my named branch 20111225_Content_Build
(active). I tried to merge these two following these steps:
hg update default
This gives me an error: abort: untracked file in working directory differs from file in requested revision: 'target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml'
and then when i try to merge: hg merge 20111225_Content_Build
i get an error stating that i cannot merge with a working directory?
abort: merging with a working directory ancestor has no effect
I do have several generated target/
files that have not been committed or pushed, do i need to push these files in order to merge these two branches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新时的消息告诉您您的
pom.xml
文件未添加到您的分支中,但默认添加。因此,当您hg update default
时,Mercurial 需要放弃pom.xml
文件中的更改,并用default
中签入的版本覆盖它code>,但 Mercurial 总是拒绝丢弃数据,除非您真的非常坚持。您有两个简单的选择:
如果您想保留对分支中的
pom.xml
所做的更改,并将它们合并到存储在 < code>default 分支,然后执行以下操作:hg add target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
hg commit target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
如果(相反)您想放弃对分支中的
pom.xml
然后只需执行以下操作:rm target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
在其中任一操作之后,您将能够执行以下操作:
hg update default
hg合并20111225_Content_Build
The message when you update is telling you your
pom.xml
files is not added in your branch, but is added in default. So when youhg update default
Mercurial would need to discard the changes in yourpom.xml
file and overwrite it with the version that's checked-in indefault
, but Mercurial always refused to throw away data unless you really, really insist.You've got two easy options:
If you want to keep the changes you made to
pom.xml
in the branch and merge them into the pom.xml stored in thedefault
branch then you do this:hg add target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
hg commit target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
If (instead) you want to discard the changes to
pom.xml
in the branch then just do this:rm target/m2e-wtp/web-resources/META-INF/maven/org.bixin.dugsi/Dugsi_Manager/pom.xml
After either one of those you'll be able to do:
hg update default
hg merge 20111225_Content_Build