Nicholas Finch
Nicholas Finch

Reputation: 327

How do I manage users on Bitbucket

I have been reading the bitbucket documentation and I am still confused about how to manage users well on my repo.

I want to give some developers the ability to pull and push to certain branches but not others, i.e. they can pull and push to a developer-master branch, but the final merges to the live master branch is something that only an admin can do.

In addition to this, I would love for this to require their own individual passwords, but not a password that gives them access to the entire repository. Right now a push requires only one password for the entire repository, which also gives them admin access to the entire bitbucket repository.

I did read the documentation but am still unclear on how to do this effectively. Help! :)

Upvotes: 7

Views: 15564

Answers (3)

mitesh keswani
mitesh keswani

Reputation: 153

Additionally, there is a chance that you do not have admin access. In that case, you won't have Setting displayed in your left panel. So, before moving ahead do verify that you have admin access to the repo.

Upvotes: 0

VonC
VonC

Reputation: 1324043

Original answer (July 2013)

I don't think you can assign permissions for branches of a repository (see below).
There is a pending ticket on that (issue 5554).

That mean I would rather clone that repo on the server (a "fork"), in order for the developers to push to any branch they want, and for an integrator to pull from that dev repo and update the master branch of the live repo.


Update post Sept 2013:

The ticket mentioned above has been resolved (see comment-5845513)

We've released branch restrictions which can be configured via the repository admin "Branch management" screen.

See BitBuket Branch management

To prevent any user from pushing to a branch, you can, do this:

  1. Create a group called EmptyGroup on your account.
    You can name the group anything you like. We recommend you choose a name that reflects how the group is used.
  2. Give the group write permissions.
  3. Go to the Branch Management page.
  4. Locate the Limit pushes to specific users and groups section.
  5. Limit pushes to a branch to the EmptyGroup group.

Any user not part of the group would not be able to push to that branch.

Upvotes: 1

Owaeis N.
Owaeis N.

Reputation: 66

Go to settings of the repo and choose 'Branch Management'.

Here you can give write access to specific branches to any users or groups you want. All of the rest branches will have write access from all of the users and groups (who have write access in general).

Take the example of my repo named bqotd.

I have four branches in this repo: htmls, design, docs and master. I wanted to limit write access of our front-end developer to htmls branch only so I had to do this:

bitbucket screenshot

I had to give write access to everyday except FED to all of the branches other than htmls branch.

Upvotes: 3

Related Questions