Question on "Merge only after pull request" restriction

I have set up a baseline branch to restrict all users from pushing to it, as I only want code merged after a pull request has been approved.

This works fine if the Stash GUI is used to do the merge.

However, there are times when the pull request has been approved after the head of the baseline branch has moved on significantly.

I'd like to be able to do the approved merge to my local baseline branch, verify the build locally (possibly fixing errors caused during the merge), then push the baseline branch back to the repository. This is particularly important when the changes overlap and the merges are non-trivial.

When I try this, the git push is rejected, as no-one is allowed to push to the baseline branch, even though the merge was of an approved pull request.

Is there a  way to allow this behaviour? I've read the documentation but couldn't find anything in there.

 

1 answer

This widget could not be displayed.
Gonchik Tsymzhitov Community Champion Jan 10, 2018

Hello Glyn, 

As I understand do you want decline the push to base line branch. 

If I were you I will set the branch permission on repo,  

then develop own pre-receive hook:

references:

Or another point is the use some hook from marketplace.

 

Hope it helps 

 

Cheers,

Gonchik Tsymzhitov

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

70 views 2 3
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