1

Our project has a Git develop branch and each developer is working on a specific feature branch that was created from that branch at some point.

So let's say I have the feature1 branch and the feature2 branch, and I need in feature2 some changes that were made in feature1.

Is it ok to merge feature1 into develop and then merge develop into feature2? What's the right way of doing this?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34

1 Answers1

1

Sure! If feature1 were finished then you merge it into develop, then merge the latest develop into your branch, and then continue your work. Once it is done you merge your feature2 into develop. That is the best way to do it, if you would try to merge feature2 into develop without first merging the latest changes into your branch it is likely to be rejected because develop is ahead of your feature2 branch.

If feature1 is not yet finished, but you still need your changes that were made there you have 2 options:

  1. branch off of feature1
  2. Just merge feature2 directly into feature1.
Chai
  • 1,796
  • 2
  • 18
  • 31