This question is in reference to Atlassian Documentation: Using branch permissions
Hi, I am aware that you can restrict write access to branch patterns via 'prevent all changes' and other restrictions which are mostly about what you can push to repository, but does anyone know if it is possible to restrict read access to a specific branch?
Thanks!
Not that I'm aware of - it would be difficult/impossible since the cloned repo has all of the commits in it and the underlying git model affords no such security.
Many thanks Rich,
that was my assumption also but I thought it was worth asking. I have been looking at how to translate a Gitolite configuration to Bitbucket Server permission settings.
In Gitolite it seems you can specify that a user can only read from the master branch for example. In practice, this presumably means that the remote only serves commits reachable from master, which I would have thought is quite doable technically (in fact I am sure that the client could configure that via a refspec)
Best Regards,
Philip
So how does that work when you clone a repository?
If you have read access to master branch only, when you clone you get a repository with the master branch and all commits reachable from it, but no other branches (or commits only reachable from those other branches).
You can actually choose to do this (with any remote) by doing:
git clone remote-url --branch master --single-branch
but I was hoping there might be a way to force that via a server permission
It looks like you're new here. Sign in or register to get started.