プル リクエストを作成して変更をマージする
マージ前にコードを確認して承認するレビュアーを追加するには、次にプル リクエストを作成します。プル リクエストはコード レビューの場所として機能するだけでなく、元のリポジトリに対する変更の比較 (diff; 差分) を示して、準備ができたらコードを簡単にマージできるようにします。
ステップ 1. プルリクエストを作成する
プル リクエストを作成するには、ブランチが必要です。このチュートリアルの前のセクションで作成したブランチを使用しましょう。
オープンなリポジトリから、[作成] ボタン > ドロップダウン メニューの [このリポジトリ] セクションで [プル リクエスト] の順に選択します。
プル リクエスト フォームの残りの箇所に入力します。各フィールドの説明については、以下のスクリーンショットを参照してください。
最後のコミット メッセージがタイトルとして自動的に入力されています。
必要に応じて [説明] を追加します。
(オプション - レビュアーを追加する) マージ前にコードの確認者または承認者が必要な場合、右サイドバーの [詳細] タブから追加します。[レビュアーを追加] を選択して、新しいプル リクエストへのレビュアーの追加を開始します。以下のプル リクエストの例では Breezy Cloud という名前のレビュアーが追加されています。 In order to add a reviewer to a pull request, you must first grant the user access to your repository by adding them to a group. For more information and detailed steps, refer to the following: Grant repository access to users and groups. Note: You can always create the pull request and then add reviewers later. |
3. Select Create pull request. Make sure you are in the repository where you want to create the pull request.
Bitbucket でプル リクエストが開き、レビュアーが追加されている場合、レビューするプル リクエストの詳細を記載したメール通知がレビュアーに送信されます。
ステップ 2. プルリクエストをマージする
Not so fast! You may have noticed the Merge button at the top. Before you select it, you need to wait for an approval of your changes. In addition to the email notification your teammates receive, they'll also see the pull request appear under Pull requests to review on the Your work dashboard.
From the pull request, the reviewer can view the diff and add comments to start a discussion before selectomg the Approve button.
When someone approves your pull request, you'll get an email notification. Once you've got the approvals you need (in this case just one!), you can merge. From the pull request, select Merge. And that's it! If you want to see what it looks like when your branch merges with the main branch, select Commits to see the commit tree.
この内容はお役に立ちましたか?