Block writing to Master in Stash?

Tim_Brigham September 2, 2013

I'd like to enforce that any development be done by branching the code, putting it through review and then performing a pull request to merge with the master branch. How exactly do I need to set this up?

It looks like the repository permissions *write* setting grants *both* the ability to merge and the ability to push. Is there any way around that? I really don't want it to be possible to push directly to master without going through a review. I'm guessing some kind of hook is necessary but I'm more of a sysadmin.

2 answers

1 accepted

3 votes
Answer accepted
ThomasA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2013

Hi Tim,

One method of achieving this workflow in Stash would be to use a gatekeeper style workflow. I gave an overview of this workflow in this question.

There is also an example hook which would stop people from pushing to one branch in a repository and only allow pull requests to be merged, you could compile and extend this example to suit your needs.

Hope that helps,

Tom.

Tim_Brigham September 3, 2013

Thanks. The example hook looks promising. The Workzone hook also looks good, if I can get it tweaked appropriately.

0 votes
HarryH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2013

Folking workflow meets your requirements, it needs a project keeper to review/decline the writing to master, in this case, each person has its own master repo and project keeper can finally decide if the change can come into repo master, please see more: https://www.atlassian.com/git/workflows#!workflow-forking

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events