hg下多个heads的问题


I don't think that you actually want to delete the heads. If you do that, you will lose the work that was done in those branches.

You probably want to merge the heads back into one branch.

Say that you have a tree like this:

o  4 : Head 1
|
o  3 : Another commit
|  
| o 2 : Head 2
| |
|/
o  1 : A commit
|
o  0 : Initial commit

To get rid of the additional head without losing the work contained within it you would merge the two heads (revisions 2 and 4 in this example) like this:

hg update 4
hg merge 2
hg commit -m "Merge"

That will create another commit which has all the changes in revisions 2, 3 and 4 in a single head like this:

o     5: Merge
|\
o |   4 : Head 1
| |
o |   3 : Another commit
| | 
| o   2 : Head 2
| |
|/
o     1 : A commit
|
o     0 : Initial commit

This is standard procedure when multiple developers work on the same repository.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值