我用我的本地副本與我們的共享存儲庫做了一系列愚蠢的步驟,我正在尋找一種方法要解決這個問題。步驟如下:如何在創建多頭分支,重新綁定和合並後創建新的頭像
我用書籤有一個發展分支的多頭,其他人使用:
-o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
我創建了一個新的分支,還是局部的,一段時間後
/---------------x <- new branch -o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
一個頭,只包含我的代碼,我做了重訂別的分支
/-1'--1'-- <- rebase /---------------x <- new branch -o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
然後,我合併的底墊,然後,提交了幾次後,我合併默認
----------d-\ <-default \ /-1'--1'\ \ /---------------x--------x--x-x-x-- <- new branch -o---o---o-----o--- \----1----1------
現在,我想我的新分支推送到服務器(hg push --new-branch -b newBranch
) ,但我得到abort: push creates new remote head
,因爲提交1'
屬於dev分支。
什麼是正確的做法?我想避免創建這個額外的頭。
更新:
每請求,這是hg heads
輸出:
changeset: 839:f2033d695fcd <- want to push this
branch: newBranch
tag: tip
user: me
date: Wed Oct 31 13:05:51 2012 +0100
changeset: 826:7fde19d7f467
branch: devBranch
user: my-collegue
date: Tue Oct 23 14:59:42 2012 +0200
changeset: 820:23853bbf68df <- the part after rebase that got merged
branch: devBranch
user: me
date: Mon Oct 22 15:36:26 2012 +0200
changeset: 807:899344cfb145 <- obsolete (branch with 1's)
branch: devBranch
parent: 711:454f29c03fb1
user: me
date: Mon Oct 22 15:36:26 2012 +0200
changeset: 712:d5e8a62a7f5f <- default, needs to stay
parent: 648:2bbcc01aa191
user: me
date: Wed Aug 22 16:21:09 2012 +0200
不要使用自由的「繪圖」 - 你有控制檯命令和粘貼命令輸出的能力**格式**('hg log'或'hg glog' for tree here and at http://例如,stackoverflow.com/questions/11982648/reassigning-local-commits-to-a-different-branch-in-mercurial)。現在,請將'hg heads'的輸出與註釋相加 - 哪個頭已過時並且不能存在(完全或僅在推送目標中)。另外請閱讀關於push命令中的-r選項 –
Hi @LazyBadger,我無法爲您提供'log'的輸出,因爲提交的提交比我描述的要多得多,而且我也忘記了爲了得到的確切命令這個狀態...更新問題以包含頭部的輸出。我不明白你對'-r'選項的引用,它是如何/爲什麼它應該有幫助? –
在這種情況下不需要精確的命令 - **你**(不是我)必須看到devBranch的樹(從807和820的共同父項到826),定義* possible *(和* necessary *)合併devBranch的頭。或者只是'push -r f2033d695fcd'就足夠了 –