这就是我的所作所为。我不想要两个脑袋。我该如何解决这个问题?
~/src: hg push
pushing to ssh://hg@bitbucket.org/Neil/project
ruprojecting ssh hg@bitbucket.org 'hg -R Neil/project serve --stdio'
searching for changes
new remote heads on branch 'default'
new remote head e04226a528b5
abort: push creates new remote head e04226a528b5!
(did you forget to merge? use push -f to force)
~/src: hg push -f
pushing to ssh://hg@bitbucket.org/Neil/project
ruprojecting ssh hg@bitbucket.org 'hg -R Neil/project serve --stdio'
searching for changes
14 changesets found
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 14 changesets with 30 changes to 67 files (+1 heads)
remote: bb/acl: Neil is allowed. accepted payload.
~/src: hg pull
ruprojecting ssh hg@bitbucket.org 'hg -R Neil/project serve --stdio'
pulling from ssh://hg@bitbucket.org/Neil/project
searching for changes
no changes found
~/src: hg heads
changeset: 1177:e04226a528b5
tag: tip
parent: 1175:b5f77a454e64
user: Neil
date: Sat Feb 25 09:12:48 2012 -0800
files: src/experiments/distribution_combination.py
changeset: 1176:f7cc8d94f4f3
parent: 1162:b680e6f93f80
user: Neil
date: Thu Feb 23 15:32:36 2012 -0800
files: .hgignore src/CMakeLists.txt etc.
答案 0 :(得分:4)
如果你不想要额外的头 - 不要这样做
相反的dumb push -f:
答案 1 :(得分:3)
hg merge
这将提示您将两个头合并为一个。相反,它会自动合并所有内容,并提示您有关冲突的信息。之后,您可以对结果进行区分并将其作为新的更改列表提交。
答案 2 :(得分:3)
这通常表明自上次拉扯以来其他人一直在推动。虽然您可以提供-f标志来强制推送,但正如您所看到的那样,这只会产生一个新的头部。
解决方案是更新到要合并到的头部,然后运行hg merge,然后执行/ push。