プル リクエストのマージ
Once you are ready to merge a pull request, and when the reviewers have approved it, click Merge at the top right of the pull request view. You can merge a pull request if you have write (or admin) permission on the project.
Bitbucket Server では特定のレビュー ワークフローを強制することはないため、プル リクエストをオープンしたユーザーを含む、リポジトリへの書き込み権限を持つすべてのユーザーがプル リクエストをマージできます。この柔軟性により、Bitbucket Server で異なるチームが異なるアプローチを利用できます。チームで厳密な制御が必要な場合、プル リクエストをマージできるユーザーを特定のユーザーまたはグループに制限するブランチ権限の利用をご検討ください。また、自分のレビュー チームのメンバーによる承認のマージのみを許可したりするような特定のワークフローを強制したい場合、プラグインの利用をご検討ください。マージ チェックの有効化の詳細については「プル リクエストのマージ チェック」ページをご確認ください。
[プル リクエストのマージ] ダイアログでは、プル リクエストの情報をコメントに追加できます。追加したテキストは、タイトル行と、Bitbucket Server および Git が生成するログ行との間に表示され、マージのコミット メッセージにテキストを追加します。
The Merge pull request dialog
マージ後にソース ブランチを削除する
リポジトリでブランチが不要な場合、[マージ後にソース ブランチを削除] を選択します。Bitbucket Server は削除を許可する前にいくつかの事項を確認します。次のような場合、マージされるブランチは削除されません。
- ブランチが既定のリポジトリ ブランチである場合。
- ユーザーにブランチの削除権限がない場合。
- ブランチがオープンなプル リクエストに従っている場合。
プル リクエストが承認されると、[プル リクエスト] タブにマージ済みとマークされます。マージを妨げる競合が Bitbucket Server によって検出された場合、プル リクエストの [概要] および [差分] タブに通知が表示されます。[詳細を見る] をクリックして、ローカル リポジトリで競合を解決する方法の手順を確認できます。
マージ戦略を選択する
Git のマージ戦略は、マージ後の Git 履歴の表示に影響します。マージ戦略は [プル リクエストのマージ] ダイアログで選択できます。管理者は、提供されるマージ戦略と、既定になるマージ戦略を構成できます。
プル リクエストのマージ時にマージ戦略を変更するには、使用するマージ戦略をクリックして ([マージ] ボタンの横) 新しいものを選択します。
Bitbucket Server では次のマージ戦略が利用可能です。
- Merge commit (
--no-ff
) DEFAULT: Always create a new merge commit and update the target branch to it, even if the source branch is already up to date with the target branch. - Fast-forward (
--ff
): If the source branch is out of date with the target branch, create a merge commit. Otherwise, update the target branch to the latest commit on the source branch. - Squash (
--squash
): Combine all commits into one new non-merge commit on the target branch. - Fast-forward only (
--ff-only
): If the source branch is out of date with the target branch, reject the merge request. Otherwise, update the target branch to the latest commit on the source branch. - Squash, fast-forward only (
--squash --ff-only
): If the source branch is out of date with the target branch, reject the merge request. Otherwise, combine all commits into one new non-merge commit on the target branch.