How can I deal with not approved pull requests with feature dependencies?

Suppose i have a feature A and make a push to the remote server and then a PR with develop branch, then someone assign to me feature B which it needs some of the code on feature A , but feature A is not approved yet.

How can i manage this? Should i create a new local branch upon feature A instead of develop ? Or what would be the best practice?

By the way, I’m using gitflow workflow

That would be common practice, yes. Two things to be aware of:

  1. If branch A is rebased (including rebase-merge), or squash-merged into develop your branch B will contain commits originating from branch A that probably shouldn’t become part of history. You’ll have to clean that up before merging branch B into develop.
  2. Similarly, if there is still development (as in, new commits) on branch A you might have to merge them into branch B, or rebase B, to make sure you have the latest state. Technically you could keep developing B and look at the differences when it’s time to merge, but usually it’s easier to handle them early.
1 Like