Configuring user branches

You can define a namespace for user branches.

About this task

When a user branch namespace prefix is defined (for example, refs/heads/users/$user), the push operation to a branch is checked to determine if it matches the namespace pattern. If the namespace pattern does not match, the branch is governed by rules that are defined in the corresponding process area. However, if it matches, then it replaces the $user with the user ID of the user who performs the push operation and compares that with the branch name user is attempting to create/update. If the user in the branch name does not match with the current user ID, then push is rejected; otherwise, push is accepted.

For example refs/heads/users/$user, if a user mike authenticates the server and attempts to push commits or create a branch refs/heads/users/bill/jke-banking-mobile-app, it is rejected because this branch belongs to the namespace allocated to the user bill. However, if the same user tries to push to the branch refs/heads/users/mike/build-rtc-git, it goes through, since that branch belongs to this user's namespace.

To allow code sharing, no permission checks are performed while accepting changes from other user's branch. For example, the user mike can pull/fetch changes from the branch refs/heads/users/bill/jke-banking-mobile-app.

Procedure

  1. In the repository editor, click the Advanced tab.
  2. On the Advanced page, in the Namespace prefix for User Branches field, type the namespace. For example, refs/heads/users/$user.
  3. Save the changes.