4 ms·
to my knowledge the easiest version of this manoeuvre, if you still have feature-1, is git checkout feature-2 git rebase feature-1 --onto master rathe
by ossopite 5y ago
to my knowledge the easiest version of this manoeuvre, if you still have feature-1, is
git checkout feature-2
git rebase feature-1 --onto master
rather confusing. is there a better way?
edit: oh, you mentioned extra commits on master since the squash of feature-1. does that require two rebases?
git rebase feature-1 --onto master-at-feature-1
git rebase master
- hardwaregeek 5y agoso assuming you have merged feature-1 onto master and squashed, you check how many commits have been made since feature-1 on feature-2 (in my prior example 2 commits of 7, 8) and do: git rebase --onto master HEAD~2
- lmm 5y ago> does that require two rebases? No. Just git rebase --onto=master feature-1 will do the right thing. (Personally I merge rather than rebasing to avoid this whole problem).