Stash: Merge two branches regularly

I have a dev branch created from master and I would like to setup a regular daily merge between these two branches or whenever a commit is done in master branch. How can I do this in stash, or should I write sctipts to merge two branches.

2 answers

1 accepted

Hi Subramanian,

There isn't currently a way to do that in Stash. Personally I would use a CI server like Bamboo/Jenkins to schedule a script that merges the two and pushes back to dev.

That said, have you seen the Stash Automerge feature, although I'm not sure it works between the dev/master branches. Generally if you have two master branches that you need to keep in sync the upstream branch should _always_ contain all changes from the downstream. In this case if you're making changes in master that need to be in dev it should be the developer who made the changes that should have to deal with the conflicts, not someone in charge of the daily build.

Does that make sense?

Charles

I am evaluating stash and currently we are pulling all the commits from hg to git ( master branch ) and then get it merged to dev branch , where we have done local changes to get it built using CI tool. Right now I create a pull request and merge those two branches ( ideally there is no conflict ).

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

689 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot