跳至主要内容

过滤拉取请求中的文件

为了帮助您快速审查大型拉取请求中的更改,您可以筛选已更改的文件或使用文件树在文件之间导航。

您可以按文件扩展名类型(例如 .html.js)、没有扩展名、代码所有权或点文件来筛选拉取请求中的文件。您还可以使用文件树按文件路径筛选、在文件之间导航或查看已更改文件的高级视图。

使用文件筛选下拉菜单

提示

为了简化您的拉取请求差异视图,您还可以暂时在文件筛选下拉菜单中隐藏已删除的文件或您已经在差异中查看过的文件。

  1. 在仓库名称下,点击 拉取请求

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

  2. 在拉取请求列表中,单击您想要筛选的拉取请求。

  3. 在拉取请求页面,点击 已更改的文件

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

  4. 使用“文件筛选”下拉菜单,选择、取消选择或单击所需的筛选项。

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

  5. 可选地,要清除筛选选择,请在 已更改文件 选项卡下,单击 清除筛选

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

使用文件树

  1. 在仓库名称下,点击 拉取请求

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

  2. 在拉取请求列表中,单击您想要筛选的拉取请求。

  3. 在拉取请求页面,点击 已更改的文件

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

  4. 单击文件树中的文件以查看相应的文件差异。如果文件树已隐藏,单击以显示文件树。

    注意

    如果屏幕宽度过窄或拉取请求仅包含一个文件,文件树将不会显示。

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

  5. 要按文件路径筛选,请在 筛选已更改的文件 搜索框中输入文件路径的部分或全部内容。或者,使用文件筛选下拉菜单。更多信息,请参阅 使用文件筛选下拉菜单

延伸阅读

© . This site is unofficial and not affiliated with GitHub, Inc.