所以我想从这种状态出发:
A - B - C - D - E
至此状态:
A (feature/1 branch)
B (feature/2 branch)
C (feature/3 branch)
D (feature/4 branch)
E * master
我该如何做?预先感谢。
让P
成为A
的父项。据我了解,您希望每个提交都将P
作为其父级。对于每个提交,在此处创建一个分支,然后通过将其从其当前父级“剪切”下来并“粘贴”至P
:
git checkout -b feature/2 B
git rebase HEAD~1 --onto P
git checkout -b feature/3 C
git rebase HEAD~1 --onto P
依此类推。 A
已经具有P
作为其父级,因此您只需要git branch feature/1 A
来创建分支。