問題:
I've a tree like this:我有一棵這樣的樹:
(commit 1) - master
\-- (commit 2) - (commit 3) - demo
\-- (commit 4) - (commit 5) - PRO
and I have to move the PRO branch to master我必須將 PRO 分支移動到 master
(commit 1) - master
|-- (commit 2) - (commit 3) - demo
\-- (commit 4) - (commit 5) - PRO
I've tried a git rebase master
from PRO branch, but nothing happens.我已經嘗試了 PRO 分支的git rebase master
,但沒有任何反應。
To clarify : I was working in master and then I had to make a product demo ( git checkout -b demo
and some commits).澄清一下:我在 master 工作,然後我不得不製作一個產品演示( git checkout -b demo
和一些提交)。 Then, by mistake, I create another branch from demo ( git checkout -b PRO
and some commits) and now I need to move PRO branch to master and leave demo intact.然後,我錯誤地從演示創建了另一個分支( git checkout -b PRO
和一些提交),現在我需要將 PRO 分支移動到 master 並保持演示完好無損。 At the end, both demo and PRO will hang from master.最後,demo 和 PRO 都將掛在 master 上。
解決方案:
參考一: https://en.stackoom.com/question/jXbT參考二: https://stackoom.com/question/jXbT