Merge pull request no automatic merge

Hi,

We are currently using  Stash's auto merge feature to roll changes forward between releases. We also use Pull Requests to get the nice Peer Review features.

We have just come across an issue where we had two release branches (e.g. 1.0 and 1.1) on the go and we had to put in an emergency fix into 1.0. This had already been fixed in a different way in 1.1. In this case we still want to use a pull request for the peer review however we don't want to automatically merge the change forward because it will cause a merge conflict that we don't want to have to solve or even worse it will merge in an unexpected manner.

Is it possible to do this, merge the pull request but opt out of the automatic merge? We are aware that any changes we did want to roll forward past this point would have to be cherry picked.

1 answer

1 accepted

1 vote
Adam Ahmed Atlassian Team Oct 07, 2014

You can't opt-out of auto-merge except by manually turning off auto-merge in the repository settings.

One thing you can do though, is to do a no-op merge to 1.1 before merging the 1.0 PR. From your situation it sounds like you want to mark the PR as merged to 1.1 without actually taking any of the changes in the PR. Git lets you do this with the "ours" strategy. E.g.

 

git checkout 1.1
# "merge" in the change, without actually taking the file changes
git merge -s ours my-pr-to-1.0
git push

Now when you merge the PR to 1.0, it will have already been merged to 1.1, so the auto-merge won't make any changes to 1.1.

I figured this would be the case. That also seems like a good work around. Thanks Adam.

Adam Ahmed Atlassian Team Oct 09, 2014

After thinking about it a bit, I created https://jira.atlassian.com/browse/STASH-5356 as an enhancement for doing this through the UI. I'm not sure we'll implement it, but I personally would find it useful. :)

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...

24,053 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