Skip to main content

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-10-12. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise にアップグレードします。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせく� さい

Reviewing proposed changes in a pull request

In a pull request, you can review and discuss commits, changed files, and the differences (or "diff") between the files in the base and compare branches.

About reviewing pull requests

You can review changes in a pull request one file at a time. While reviewing the files in a pull request, you can leave individual comments on specific changes. After you finish reviewing each file, you can mark the file as viewed. This collapses the file, helping you identify the files you still need to review. A progress bar in the pull request header shows the number of files you've viewed. After reviewing as many files as you want, you can approve the pull request or request additional changes by submitting your review with a summary comment.

ヒント: 検索修飾子 review-requested:[USERNAME] または team-review-requested:[TEAMNAME] が使用された、自分または自分がメンバーであるチー� が確認を求められているプルリクエストを探すことができます。 詳細については、「Searching issues and pull requests」 (問題とプルリクエストの検索) を参照してく� さい。

Starting a review

  1. リポジトリ名の下にある [pull request] をクリックします。 [pull request] タブの選択

  2. プルリクエストのリストで、レビューしたいプルリクエストをクリックします。

  3. On the pull request, click Files changed. Pull Request Files changed tab

  4. Optionally, filter the files to show only the files you want to review. For more information, see "Filtering files in a pull request."

  5. コメントを追� するコード行にカーソルを合わせ、青いコメント アイコンをクリックします。 複数行にコメントを追� するには、クリックしてドラッグして行の範囲を選択し、青いコメント アイコンをクリックします。 青いコメント アイコン

  6. コメントフィールドにコメントを入力してく� さい。 コメント フィールド

  7. Optionally, to suggest a specific change to the line or lines, click , then edit the text within the suggestion block. Suggestion block

  8. When you're done, click Start a review. If you have already started a review, you can click Add review comment.

    Start a review button

Before you submit your review, your line comments are pending and only visible to you. You can edit pending comments anytime before you submit your review. To cancel a pending review, including all of its pending comments, scroll down to the end of the timeline on the Conversation tab, then click Cancel review.

Cancel review button

Reviewing dependency changes

注: 依存関係のレビューは現在ベータ版であり、変更される可能性があります。

If the pull request contains changes to dependencies you can use the dependency review for a manifest or lock file to see what has changed and check whether the changes introduce security vulnerabilities. For more information, see "Reviewing dependency changes in a pull request."

  1. On the pull request, click Files changed. Pull Request Files changed tab

  2. On the right of the header for a manifest or lock file, display the dependency review by clicking the rich diff button.

    The rich diff button

  3. 依存関係を変化させないような変更がマニフェストあるいはロックファイルに行われているかもしれず、あるいはGitHubがパースできず、その結果として依存関係レビューに現れてこない依存関係があるかもしれないので、ソースdiffをレビューしたいこともあるでしょう。

    ソース diff のビューに戻るには、 ボタンをクリックしてく� さい。

    ソース diff ボタン

Marking a file as viewed

After you finish reviewing a file, you can mark the file as viewed, and the file will collapse. If the file changes after you view the file, it will be unmarked as viewed.

  1. On the pull request, click Files changed. Pull Request Files changed tab

  2. On the right of the header of the file you've finished reviewing, select Viewed.

    Viewed checkbox

Submitting your review

After you've finished reviewing all the files you want in the pull request, submit your review.

  1. On the pull request, click Files changed. Pull Request Files changed tab

  2. 変更されたコードの上にある [変更の確認] をクリックします。 [変更の確認] ボタン

  3. 提案された変更についてのフィードバックをまとめたコメントを入力してく� さい。 レビューのまとめコメント ウィンドウ

  4. Select the type of review you'd like to leave:

    Radio buttons with review options

    • Select Comment to leave general feedback without explicitly approving the changes or requesting additional changes.
    • Select Approve to submit your feedback and approve merging the changes proposed in the pull request.
    • Select Request changes to submit feedback that must be addressed before the pull request can be merged.
  5. [レビューをサブミット] をクリックします。

ヒント:

  • 必要なレビューが有効になっており、リポジトリへの 書き込み管理者、または 所有者 アクセス権を持つコラボレーターが変更を要求するレビューを送信した� �合、同じコラボレーターが pull request の変更を承認する別のレビューを送信するまで、pull request をマージすることはできません。
  • リポジトリのオーナーと管理者は、プルリクエストが承認レビューを受けていなかったり、あるいは変更をリクエストしたレビュー担当者がOrganizationを離れていたりアクセスできなくなっている� �合でも、プルリクエストをマージできます。
  • 必� �レビューと古いレビューの棄却がどちらも有効化されており、承認済みのプルリクエストのブランチにコードを変更するコミットがプッシュされた� �合、その承認は却下されます。 そのプルリクエストは、再度レビューされ承認されるまではマージできません。
  • 同じコミットを指す複数のオープンされたプルリクエストがあり、それぞれがheadブランチを持つ� �合、いずれかがペンディングあるいは拒否されたレビューを持っているなら、それらはマージできません。
  • 書き込みまたは管理者のアクセス許可を持つ個人からのレビューの承認を必� �としているリポジトリの� �合、これらのアクセス許可を持つ個人からの承認には緑色のチェック マークが表示され、これらのアクセス許可を持たない個人からの承認には灰色のチェック マークが表示されます。 灰色のチェック マークが付いた承認は、pull request をマージできるかどうかに影響しません。
  • Pull Requestの作者は、自分自身のPull Requestを承認することはできません。

Further reading