Search code examples
git-stash

Is there any way to set a Git branch as readonly with Stash?


In our office we are using Stash without server access (maximum access level is create branch) so we need to restrict a particular Git branch from the pushes. So simply, what we need to do is we need to freeze our branch after the release.

Currently what we are doing is we replicate the feature branch and remove that branch from the remote, but that is bit risky.

Are there any other possible solutions?


Solution

  • You should be able to associate to that branch a permission which suits your need.
    See "Stash: Using branch permissions".

    https://confluence.atlassian.com/download/attachments/313460915/STASH310_branch_permissions.png?version=1&modificationDate=1433809165549&api=v2

    By limiting write access to a specific owner, for instance, you remove push for all other contributors.