Automatic merging for a different branch in bitbucket

We are using Bitbucket to store and Jenkins to deploy set of web pages. in our case master branch is the production branch and there a staging branch which hosts the QA data. there are multiple projects going on at the same time and therefore we cannot make a full pull request from staging branch to master branch as there are other changes. again once a web page is moved to production there is a production specific commit to change the web page html (angular) id to the production value as the staging and production are having different IDs.

we are using individual feature branches branched out from the master branch to create a new project. In our scenario, staging should be having all the features which are in development because it represents the common testing environment. each feature developed are mini websites and therefore is independent of each other. but we should be able to deploy them to production individually while all should be exists in staging at the same time for testing by individual teams.

I tried creating a pull request from the feature branch to staging but that will bring the production specific commits done in the master branch to the staging branch in other pages. in summary, this is the approach for one website. there are more of these going in parallel. enter image description here

I feel that I'm not doing this the correct way. if there is a better way of doing this, please let me know. again is there a way that any changes done to feature branches to be automatically merged to the staging branch?

Upvotes: 4

Views: 6915

Answers (1)

Michael Kang
Michael Kang

Reputation: 52847

I recommend following the git flow branching model:

http://nvie.com/posts/a-successful-git-branching-model/

There are two long-living branches: Master and Develop, where Develop was branched off of Master.

Features are developed on feature branches off of Develop. Once a project is ready for release, merge the feature branch into the Develop branch, and create a release branch right after. The release branch should only contain bug fixes.

When the release branch is ready for production, merge from Release into Master, and from Release back into Develop. Tag the Master branch when the Release branch is merged into Master. Make sure that you use the no-ff option so that the commit is recorded.

enter image description here

Upvotes: 5

Related Questions