Restrict Creation of Branches to Certain Patterns

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

 

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

要約

In certain use cases, there is a requirement to limit users from creating branches based on specific branch patterns. This document elaborates on how to achieve this restriction, ensuring controlled access to branch creation.

ソリューション

To implement branch creation restrictions, one can utilize the powerful feature of "Branch Permissions" in Bitbucket Cloud.

Example Scenario: Let's consider a situation where it is necessary to restrict branch creation to only the patterns "main", "test" and "test-123," while all other branch creations should be restricted.

To accomplish this, the following branch permissions can be set:

  1. Pattern "*" (No Write and Pull Request Merge):

    • With this permission, users are restricted from creating branches with patterns other than "main" and "test-123".
  2. Main Branch (Allow Write and Pull Request Merge):

    • By enabling this permission for certain users or groups, they gain the ability to create branches with the pattern "main" and perform pull request merges.
  3. Test* Branch Pattern (Allow Write and Pull Request Merge for Certain Users):

    • Here, specific users or groups are granted write and pull request merge permissions for branches matching the pattern "test*" (e.g., test-123, test-feature, etc.).


By configuring these branch permissions in Bitbucket Cloud, organizations can ensure controlled access to branch creation and maintain a structured branching strategy that aligns with their development workflow.

注意

One additional important point to consider is the issue of branch permissions overlap. Overlapping branch permissions can occur when specific permissions are set for a branch name, such as "main," and at the same time, wildcard (*) branch patterns are also defined in the permissions. In such cases, both the specific permission for the named branch and the wildcard permission would apply to the branch with the matching name.



Here are some examples to illustrate the results of overlapping permission definitions:

ワイルドカード (*) ブランチ パターン

Specific ("main") branch name

両方の制限に含まれるブランチに適用される制限

ユーザーまたはグループ制限 (書き込みまたはマージ アクセス)

ユーザーまたはグループがリストされていない

Alana

Alana のみがアクセス権を保持

全員

Alana

Alana のみがアクセス権を保持

Alana

Harvey

Alana と Harvey の両方がアクセス権を保持

Alana

ユーザーまたはグループがない

Alana のみがアクセス権を保持

Alana

全員

Alana のみがアクセス権を保持

It's essential to be mindful of these overlaps to ensure proper branch access control. 


If the above instructions are not sufficient for your use case, please raise a support ticket or raise a community support ticket for further assistance with this.

説明 Restrict Creation of Branches to Certain Patterns
製品Bitbucket Cloud



最終更新日: 2024 年 2 月 5 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.