Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save reinislejnieks/52ebf0dcb37e33a5e12f0d4cf5a24418 to your computer and use it in GitHub Desktop.
Save reinislejnieks/52ebf0dcb37e33a5e12f0d4cf5a24418 to your computer and use it in GitHub Desktop.
#git - Working on a branch with a dependence on another branch that is being reviewed
Git is very flexible. Here's one way you can do it.
Your first branch featureA is up for review.
Your second branch featureB is in development and depends on the code in the featureA branch.
Merge the featureA branch into the featureB branch.
If you make changes to the featureA branch then you should merge the featureA branch into the featureB branch again to incorporate the changes.
You should also make sure to merge featureA into the main trunk first, otherwise when you merge featureB into the main trunk you will inadvertently also merge featureA. Once featureA is merged into the main trunk you can get rid of the featureA branch as featureB only depends on the main trunk now.
I prefer it when my feature branches do not depend on each other but sometimes they do and you have to roll with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment