Submit several pull requests that depends on each other


April 2019


37 time


I forked a project on Github. So far I have used the usual approach which consist in creating a specific branch, make some specific changes, push it to origin and create the pull request for the upstream repo.

Now let's assume I have created branch B1 to fix a problem in the code and create a pull request out of it. Then I want to keep working and add a new feature. So I create branch B2 from the same point as B1 on master.

The problem I have is that for the code in B2 to work properly I need to also get the fix from B1. How to manage that on my local repo knowing that the pull request from B1 has not yet been integrated in upstream so I cannot fetch-merge from upstream before branching B2.

Am I clear :-) ?

1 answers


You can create your branch B2 from your branch B1, so it will contain the fix. Then, once B1 is merged in master, you can rebase the branch B2 on master and continue to work on it.