Delete multiple heads

淺唱寂寞╮ 提交于 2019-12-11 06:18:49

问题


C:\Users\Itu\workspace\Compiler>hg branches
default                       13:aa6af82c5458

C:\Users\Itu\workspace\Compiler>hg heads
changeset:   13:aa6af82c5458
tag:         tip
user:        Itun
date:        Sun Sep 18 22:27:06 2011 +0400
summary:     Update 1.0.0.2

changeset:   9:d36e5ac454b1
parent:      -1:000000000000
user:        Itu
date:        Sun Sep 18 06:50:25 2011 +0400
summary:     New PR

changeset:   8:758cd394d82a
user:        Itun
date:        Sun Sep 18 06:48:17 2011 +0400
summary:     asdasd

changeset:   4:c4c981b4ff43
user:        Itun
date:        Sun Sep 18 03:31:58 2011 +0400
summary:     Update
C:\Users\Itu\workspace\Compiler>hg merge
abort: branch 'default' has 4 heads - please merge with an explicit rev
(run 'hg heads .' to see heads)

How you can see I have the one branch and 4 heads. When I try to pull in my eclipse mercurial plugin, it returns me message about multiple heads and offers me to rebase or merge. Then I did not understand anything and closed it. I think I need something to delete this heads. It would be great if somebody could explain me this and show how to do this in the eclipse plugin, but other help is appreciated.


回答1:


The safest way to remove the extra heads is to make a new clone, grabbing just the head you want with -r:

cd C:\Users\Itu\workspace
mv Compiler Compiler-backup
hg clone -r aa6af82c5458 Compiler-backup Compiler 

This will move just aa6af82c5458 and its ancestors to the new clone, leaving the old heads in Compiler-backup. You can always hg pull them over later, or just delete the backup (losing your data).




回答2:


Mercurial has an entire wiki page devoted to the topic of multiple heads.

I highly suggest reading it before proceeding on your apparent course of action.

The folks at Fog Creek have provided some friendlier material.

You might consider working with them, since it sounds like you might need some support.



来源:https://stackoverflow.com/questions/7463712/delete-multiple-heads

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!