Filtering and searching issues and pull requests

To find detailed information about a repository on GitHub Enterprise Server, you can filter, sort, and search issues and pull requests that are relevant to the repository.

提示:您也可以使用 GitHub CLI 过滤议题或拉取请求。 更多信息请参阅 GitHub CLI 文档中的 "gh issue list" 或 "gh pr list"。

Filtering issues and pull requests

Issues and pull requests come with a set of default filters you can apply to organize your listings.

使用搜索限定符 review-requested:[USERNAME]team-review-requested:[TEAMNAME] 可查找请求您或您所属团队审查的拉取请求。 更多信息请参阅“搜索议题和拉取请求”。

You can filter issues and pull requests to find:

  • All open issues and pull requests
  • Issues and pull requests that you've created
  • Issues and pull requests that are assigned to you
  • Issues and pull requests where you're @mentioned

提示:您也可以使用 GitHub CLI 过滤议题或拉取请求。 更多信息请参阅 GitHub CLI 文档中的 "gh issue list" 或 "gh pr list"。

  1. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 Issues(议题) Pull requests(拉取请求)议题和拉取请求选项卡选择
  3. Click Filters to choose the type of filter you're interested in. Using the Filters drop-down

Filtering issues and pull requests by assignees

Once you've assigned an issue or pull request to someone, you can find items based on who's working on them.

  1. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 Issues(议题) Pull requests(拉取请求)议题和拉取请求选项卡选择
  3. In the upper-right corner, select the Assignee drop-down menu.
  4. The Assignee drop-down menu lists everyone who has write access to your repository. Click the name of the person whose assigned items you want to see, or click Assigned to nobody to see which issues are unassigned. Using the Assignees drop-down tab

To clear your filter selection, click Clear current search query, filters, and sorts.

Filtering issues and pull requests by labels

Once you've applied labels to an issue or pull request, you can find items based on their labels.

  1. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 Issues(议题) Pull requests(拉取请求)议题和拉取请求选项卡选择
  3. 在议题列表或拉取请求上方,单击 Labels(标签)资源库议题或拉取请求页面上的标签选项卡
  4. In the list of labels, click a label to see the issues and pull requests that it's been applied to. List of a repository's labels

Tip: To clear your filter selection, click Clear current search query, filters, and sorts.

Filtering pull requests by review status

You can use filters to list pull requests by review status and to find pull requests that you've reviewed or other people have asked you to review.

You can filter a repository's list of pull requests to find:

  1. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 拉取请求
    ![Pull request tab selection](/assets/images/enterprise/3.3/repository/repo-tabs-pull-requests.png)
    
  3. In the upper-right corner, select the Reviews drop-down menu. Reviews drop-down menu in the filter menu above the list of pull requests
  4. Choose a filter to find all of the pull requests with that filter's status. List of filters in the Reviews drop-down menu

Using search to filter issues and pull requests

You can use advanced filters to search for issues and pull requests that meet specific criteria.

Searching for issues and pull requests

The issues and pull requests search bar allows you to define your own custom filters and sort by a wide variety of criteria. You can find the search bar on each repository's Issues and Pull requests tabs and on your Issues and Pull requests dashboards.

The issues and pull requests search bar

Tip: 您可以用键盘快捷键将光标焦点放在议题或拉取请求列表上方的搜索栏上。 更多信息请参阅“键盘快捷键”。

要了解有关 GitHub CLI 的更多信息,请参阅“关于 GitHub CLI”。

You can use the GitHub CLI to search for issues or pull requests. Use the gh issue list or gh pr list subcommand along with the --search argument and a search query.

For example, you can list, in order of date created, all issues that have no assignee and that have the label help wanted or bug.

gh issue list --search 'no:assignee label:"help wanted",bug sort:created-asc'

You can also list all pull requests that mention the octo-org/octo-team team.

gh pr list --search "team:octo-org/octo-team"

About search terms

With issue and pull request search terms, you can:

  • Filter issues and pull requests by author: state:open type:issue author:octocat
  • Filter issues and pull requests that involve, but don't necessarily @mention, certain people: state:open type:issue involves:octocat
  • Filter issues and pull requests by assignee: state:open type:issue assignee:octocat
  • Filter issues and pull requests by label: state:open type:issue label:"bug"
  • Filter out search terms by using - before the term: state:open type:issue -author:octocat

For issues, you can also use search to:

  • Filter for issues that are linked to a pull request by a closing reference: linked:pr

For pull requests, you can also use search to:

  • Filter draft pull requests: is:draft
  • Filter pull requests that haven't been reviewed yet: state:open type:pr review:none
  • Filter pull requests that require a review before they can be merged: state:open type:pr review:required
  • Filter pull requests that a reviewer has approved: state:open type:pr review:approved
  • Filter pull requests in which a reviewer has asked for changes: state:open type:pr review:changes_requested
  • Filter pull requests by reviewer: state:open type:pr reviewed-by:octocat
  • Filter pull requests by the specific user requested for review: state:open type:pr review-requested:octocat
  • Filter pull requests by the team requested for review: state:open type:pr team-review-requested:github/atom
  • Filter for pull requests that are linked to an issue that the pull request may close: linked:issue

Sorting issues and pull requests

Filters can be sorted to provide better information during a specific time period.

You can sort any filtered view by:

  • The newest created issues or pull requests
  • The oldest created issues or pull requests
  • The most commented issues or pull requests
  • The least commented issues or pull requests
  • The newest updated issues or pull requests
  • The oldest updated issues or pull requests
  • The most added reaction on issues or pull requests
  1. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 Issues(议题) Pull requests(拉取请求)议题和拉取请求选项卡选择
  3. In the upper-right corner, select the Sort drop-down menu. Using the Sort drop-down tab

To clear your sort selection, click Sort > Newest.

Sharing filters

When you filter or sort issues and pull requests, your browser's URL is automatically updated to match the new view.

You can send the URL that issues generates to any user, and they'll be able to see the same filter view that you see.

For example, if you filter on issues assigned to Hubot, and sort on the oldest open issues, your URL would update to something like the following:

/issues?q=state:open+type:issue+assignee:hubot+sort:created-asc

Further reading

此文档对您有帮助吗?

隐私政策

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或者, 了解如何参与。