We have a developer team of 4 and have recently moved to Git. We want to learn best practices regarding workflow with branching and merging.
We are using a lightweight version of Git Flow. We have a dev, staging and a master branch which are all linear with each other.
- staging is branched from master
- dev is branched from staging
On top of that we use feature and hotfix branches to work on new features and fix bugs.
I have the following questions:
- Should we branch feature branches from dev or from master?
- When a feature branch is ready, should we merge the feature branch into dev, then merge dev into staging, or merge the feature branch into staging and then the feature branch into master?
I think we should branch from master and merge the feature branch up, because there might be something in dev that we might not want to merge to staging and master.
What is your opinion? What are the best practices?