Skip to content

Resolving squashed and merged dependencies

Daniel Lundén edited this page Mar 2, 2021 · 2 revisions

If you have a PR branch (say feature/mexpr) which has not yet been merged upstream, and you want to start working on another PR branch (say feature/symbolize) that has the first PR (feature/mexpr) as a dependency, there is a nice procedure to correct the history when the first branch is squashed and merged upstream:

  1. Finish work on feature/mexpr and create a PR.
  2. Branch off and start working on feature/symbolize.
  3. The feature/mexpr PR gets squashed and merged into upstream/develop (i.e. the develop branch in the main repo).
  4. Now, executing the command git rebase --onto upstream/develop feature/mexpr feature/symbolize magically reapplies all work in feature/symbolize since feature/mexpr on top of upstream/develop.