In general, our code is quite modular so developers are not making changes to the same files at the same time. But, I have run into a situation and I see two ways to solve it, so I'm looking for opinions on which is the best way and why (or additional solutions). My coworker made changes to some files in his feature branch which I would like to use in my feature branch. These are separate features, not a shared feature branch. I see two solutions:
1) He can merge his feature branch into develop and push to the origin. I can then pull the develop branch and rebase my feature branch onto it locally.
2) I can merge his feature branch directly into mine.
I don't really like the latter because it just seems off; merging a feature branch into a feature branch directly when the two features themselves don't relate, just a couple of the dependencies do. So, I went with the former, but for future reference I am curious how others would handle this situation.
What you do in git is just a reflection of the development process.
1) You don't need to rebase your work on the develop branch just merge the develop branch into your working branch. If you rebase you can't share your work.
2) You need to incorporate his work but he is not ready to push to develop then there is no technical problem with you merging his work in. Just beware you may be incorporating beta work!
This isn't a git problem you are just depending on work that is not finished yet, happens all the time you just need to keep regularly merging in the other developer's's work until he is finished.