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?


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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,908 views 26 12
Join discussion

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