Skip to main content

This version of GitHub Enterprise Server was discontinued on 2024-09-25. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

Filtering files in a pull request

To help you quickly review changes in a large pull request, you can filter changed files or use the file tree to navigate between files.

You can filter files in a pull request by file extension type, such as .html or .js, lack of an extension, code ownership, or dotfiles. You can also use the file tree to filter by file path, navigate between files, or see a high level view of the changed files.

Using the file filter dropdown

Tip: To simplify your pull request diff view, you can also temporarily hide deleted files or files you have already viewed in the pull request diff from the file filter drop-down menu.

  1. Under your repository name, click Pull requests.

    Screenshot of the main page of a repository. In the horizontal navigation bar, a tab, labeled "Pull requests," is outlined in dark orange.

  2. In the list of pull requests, click the pull request you'd like to filter.

  3. On the pull request, click Files changed.

    Screenshot of the tabs for a pull request. The "Files changed" tab is outlined in dark orange.

  4. Use the File filter dropdown menu, and select, deselect, or click the desired filters.

    Screenshot of the view options for a pull request. The file filter option is outlined in dark orange.

  5. Optionally, to clear the filter selection, under the Files changed tab, click Clear filters.

    Screenshot of the view options for a pull request. The "Clear filters" option is outlined in dark orange.

Using the file tree

  1. Under your repository name, click Pull requests.

    Screenshot of the main page of a repository. In the horizontal navigation bar, a tab, labeled "Pull requests," is outlined in dark orange.

  2. In the list of pull requests, click the pull request you'd like to filter.

  3. On the pull request, click Files changed.

    Screenshot of the tabs for a pull request. The "Files changed" tab is outlined in dark orange.

  4. Click on a file in the file tree to view the corresponding file diff. If the file tree is hidden, click to display the file tree.

    Note: The file tree will not display if your screen width is too narrow or if the pull request only includes one file.

    Screenshot of the "Files changed" tab of a pull request. In the left sidebar, the file tree is outlined in dark orange.

  5. To filter by file path, enter part or all of the file path in the Filter changed files search box. Alternatively, use the file filter dropdown. For more information, see "Using the file filter dropdown."

Further reading