Loading...

How to handle pull request when its base is another branch that hasn't been merged?


Situation is as follows:

  • First bug was fixed on BranchA
  • BranchA was pushed and a pull request was made to original repo
  • Second bug fix relayed on the first fix so BranchB (containing the second bug fix) was build on top of BranchA
  • BranchB was pushed and a pull request was made to original repo

My question can be divided in these two parts:

  • How the original repo should handle this situation as the commits given on BranchB (and therefore the second PR) includes all the commits on the first PR (BranchA)?

  • Can first PR and second PR get safely merged without any issue as long as first PR gets merged first?

Graphical Situation

- - Source

Answers

answered 3 mon ago André DS #1

Here there is two ways to manage this situations :

  • Close the first PR (Branch A) and merge the second one (Branch B)
  • Merge the first PR (Branch A) and after this, merge the second one (Branch B)

First option :

First option graphical explanations

Second option :

Second option graphical expl

Concerning your second question, yes it'll be safely merge, if there is no conflict.

comments powered by Disqus