This is necessary when you develop on an child-feature-branch and the parent-feature-branch has been rebased.
0. Initial situation
3f5a---74ed [child_feature] / c1b0---62d8 [parent_feature] / e73a---6cfa---90ed [develop]
1. Rebase parent
$ git rebase develop parent_feature
3f5a---74ed [child_feature] / c1b0---62d8 [parent_feature] / e73a---6cfa---90ed [develop] \ 8cc3---729e [parent_feature] (rebased)
2. Rebase child
Bad Solution: –> Normal rebase
$ git rebase parent_feature child_feature
You have to solve the same merge-conflicts again. 🙁
Good Solution: –> Rebase onto
$ git rebase --onto parent_feature parent_feature@{1} child_feature
Alternative:
$ git rebase --onto 729e 62d8 child_feature
e73a---6cfa---90ed [develop] \ 8cc3---729e [parent_feature] (rebased) \ 27ba---ff23 [child_feature] (rebased)