问题:
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