It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can Stash (or a Stash hook) manage commit permissions on specific files or directories?

Jon Sword Jan 18, 2014

We have certain files/directories within a branch that can only be modified by special users. This was easy in SVN - but I can not find a way to do this in Stash.

Any suggestions?



1 answer

1 accepted

1 vote
Answer accepted
Charles O'Farrell Jan 18, 2014

Hi Jon,

This is obviously not possible in Stash at this stage.

It could be done fairly easily as a plugin. You could add a pre-receive hook that looks at the new commits, calculates what files/directories have been modified and rejects/accepts the push accordingly. Here is an example of a hook I wrote that blocks pushes with large files, which might be a good place to start

That said, my advice would be to split up your repository into smaller repositories and define your permissions at that level. This is something that will play better with Stash (and most other Git hosting solutions which don't support this feature either). At this point you could have repository write permissions (or branch permissions on master) and only certain people can push/merge to them.



Jon Sword Jan 24, 2014

Thanks Charles - we will investigate breaking the areas into seperate repos.



Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,802 views 1 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you