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?
Sure! If
feature1were finished then you merge it intodevelop, then merge the latestdevelopinto your branch, and then continue your work. Once it is done you merge yourfeature2into develop. That is the best way to do it, if you would try to mergefeature2intodevelopwithout first merging the latest changes into your branch it is likely to be rejected becausedevelopis ahead of yourfeature2branch.If
feature1is not yet finished, but you still need your changes that were made there you have 2 options:feature1feature2directly intofeature1.