4

在处理我的功能分支时,我不断地对它们进行重新排序和压缩,git rebase -i以保持我的历史版本更清晰。有时我会处理多个相互依赖的特性(我团队的规则是让 PR 尽可能小,因此较大特性的一个原子块通常会成为它自己的特性分支)。由于这个工作流程,我通常最终在重新定位分支后手动重新指向分支。有没有办法自动将这些指针移动到它们应该降落的位置?

因此,例如,在此图中:

5bab4818e (HEAD -> cell-toggle-comp) Added cell-toggle component
d55cab881 (toggle-comp) Toggle: Added honey traceability comment
4240f0ac3 Made Toggle a named export and replaced references to obsolete <ui> alias
90a0b2452 Refactored Switch instances to toggle
e15c758a0 Updated Switch component to latest specs (and renamed things to match design lingo)
d53090e93 (fix-switch-reference) Fixed Switch reference that was being imported from React Native instead of src/components
4a214cb72 (cell-text-selection-comp) Added CellTextSelection ui component
cef3b5716 (origin/master, origin/HEAD, master) Merge pull request #1630 from repo

假设我想交换提交e15c758a0d53090e93,但我希望fix-switch-reference分支与它的提交一起移动。有没有办法自动做到这一点?还是我必须移动提交,然后手动将分支指向新的哈希?

4

0 回答 0