プロジェクトのブランチ モデルの構成
プロジェクトにブランチ モデルを設定するには、次の手順に従います (ワークスペース管理者のみがブランチ モデルを設定できます)。
プロジェクトで、左側サイドバーの [プロジェクト設定] を選択します。
[ワークフロー] で [ブランチ モデル] を選択します。
リポジトリ ブランチ モデルの詳細 > [保存] の順に選択します。
ブランチ モデルの詳細
ブランチ モデルによって、プロジェクトのブランチ ベース ワークフローを定義できます。ワークフローをブランチ タイプにマッピングすると、利用可能なブランチ タイプを設定することでブランチ名の一貫性を確保できます。ブランチのプリフィックス案が表示されますが、独自の命名規則も指定できます。一貫した命名規則によって、ブランチをタイプごとに簡単に識別できます。また、開発と本番の各ブランチを定義できます。これによって、作成やプル リクエスト時のソースやターゲット ブランチの推奨精度を改善できます。
ブランチ タイプ
ソフトウェア開発では、複数のブランチ タイプがよく使用されます。このセクションでは、各ブランチ タイプの用途と、各ブランチ タイプのプリフィックスに関する一般的な規則について説明します。Bitbucket では、プリフィックスは開発または本番以外のすべてのブランチ用に変更できます。
開発ブランチ 通常は機能に関連する作業用の連携ブランチで、多くの場合は既定ブランチまたは独自の名前を持つブランチです。プル リクエスト ワークフローの場合、新しいフィーチャー ブランチのターゲット ブランチです。 |
|
本番環境ブランチ リリースのデプロイに使用します。開発ブランチから分岐して、開発ブランチにマージされます。Git ベースのワークフローでは、新しい本番環境リリースの準備に使用されます。 | 場合によって異なる |
フィーチャー ブランチ 特定の機能の作業または改善に使用されます。一般に、プル リクエストを使用して、開発ブランチから分岐し、開発ブランチにマージされます。 |
|
リリース ブランチ リリース タスクや長期的なメンテナンス バージョンに使用されます。開発ブランチから分岐し、本番環境ブランチにマージされます。 |
|
バグ修正ブランチ 一般にリリース ブランチの修正に使用されます |
|
ホットフィックス ブランチ 開発ブランチの変更に影響を与えずに本番環境ブランチを素早く修正するために使用されます。通常、Git ベースのワークフローでは、変更は本番環境と開発の各ブランチにマージされます。 |
|
Branch deletion when merging a pull request
When you merge a pull request, you can choose to delete the source branch after merging is complete. Project and repository admins can set the default behavior to either On (the branch will be deleted after merge) or Off (the branch will not be deleted after merge).
Users can override this setting when they merge a pull request.
Set the default for branch deletion on merge
Branch deletion on merge is set to Off by default, therefore the option to delete the branch in the Merge pull request dialog will not be selected.
制限事項
After you have enabled the delete source branch by default setting, only newly created pull requests will have the delete source branch setting set by default.
This default setting will not be set on or affect any branches where branch deletion is prohibited by a branch permission.
To change the default status of deleting a source branch on merge for a project (requires project admin permission):
Go to the project where you want to set the default for branch deletion on merge.
Select Project settings on the left sidebar.
Select Branching model on the left sidebar under Workflow.
Under Delete source branch by default, select one of the following options:
Off - When merging a pull request, the option to delete a source branch will not be selected.
On - When merging a pull request, the option to delete a source branch will be selected.
You can also set the default for source branch deletion on merge per repository. For more information on setting this for a repository, see the Branch a repository help doc.
この内容はお役に立ちましたか?