2
假设master和origin/master不同。
我在主人身上,我想提交来自原产地/主人提交后提交,然后推 - 力。git:在我提交了一个rebase命令后,他们提交
A---B---C origin/master
/
D---E---F---G *master
A---B---C origin/master
/
D---E---F---G---A'---B'---C' *master
变体1:
git branch -f tmp
git reset --hard origin/master
git rebase tmp
这种变异是不好的,因为“git的复位 - 硬”检查出一些文件和“git的重订”提交申请之前,再次改写它们。这是一项多余的工作。
变2:
git branch -f tmp origin/master
git rebase --onto master master tmp
git branch -f master
git checkout master
命令太多。我只想用一个命令来做到这一点。
你为变体2编写了一个别名,将其减少为单个命令? – simont