Stash branch permissions are not working

Under the: settings > "branch permissions" section of our repo I setup permissions on the master branch so that only one user has write permissions. I also checked the boxes for "Prevent rewriting history", "Prevent branch deletion", and "Prevent changes without a pull request". The permission is setup using the branch name, not any wildcards.

Under the "hooks" section I also have "Reject Force Push" enabled.

Despite these settings any user and push to the master branch from their local copy of the repo. They can also force push and force push a previous commit (removing the latest commits).

Stash is V3.11.2 (Updated today, this issue also occurred in V3.10.2)

Any ideas as to why Stash is ignoring these settings? This is a serious issue for us.

2 answers

1 accepted

Thanks to Ben at Atlassian Support! He was able to identify that the hooks were not executable in the stash repo.

Answer:

https://confluence.atlassian.com/display/STASHKB/Git+hook+scripts+are+not+executing

Hi Mike,

It sounds like the pre-receive hooks in your repository are not triggering correctly. If the repository that Stash maintains on disk has been modified by hand (e.g. the contents of the .git/hooks directory have been modified) you may see issues like this.

Regardless, I'd raise a support request in the Stash project at https://support.atlassian.com and our awesome support engineers will be able to take a closer look and help you out.

cheers,

TIm

Unfortunately I don't believe that is the issue as it is still true when it is a new clone of the repo and the hooks directory is untouched. I didn't see a Stash option on the support page but I created one under JIRA.

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

712 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