Is there a way to set the Git branch as read-only with Stash?

In our office we are using Stash without access to the server (the maximum level of access is the create branch), so we need to restrict a specific Git branch from being pushed. As simple as what we need to do is we need to freeze our branch after release.

We are currently replicating the feature branch and deleting it from remote, but this is a little risky.

Are there any other possible solutions?

+3


source to share


2 answers


You should be able to link to this branch with a resolution that suits you.
See " Stash: Using Branch Permissions ".

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



By restricting access to a record to a specific owner, for example, you remove push for all other members.

+4


source


Technically, you can set up a hook to prohibit pushing on a specific branch. This is discussed in Is there a way to lock a branch in GIT .

However, your statement



what we need to do is we need to freeze our branch after release

makes me think what you really want to use git tag

instead of creating a read-only branch.

+1


source







All Articles