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.
本文介绍了一种在版本控制系统中处理多个分支(heads)的方法,即通过合并而非删除分支来保留工作成果,避免丢失重要的更改。文章以具体的示例说明了如何进行分支合并。
929

被折叠的 条评论
为什么被折叠?



