此版本的 GitHub Enterprise 将停止服务 2022-02-16. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

Searching commits

You can search for commits on GitHub Enterprise Server and narrow the results using these commit search qualifiers in any combination.

You can search for commits globally across all of GitHub Enterprise Server, or search for commits within a particular repository or organization. For more information, see "About searching on GitHub."

When you search for commits, only the default branch of a repository is searched.

提示:

  • 本文章包含 GitHub.com 网站上示例搜索的链接,但您可以对 GitHub Enterprise Server 使用相同的搜索过滤器。 在链接的示例搜索中,将 github.com 替换为 your GitHub Enterprise Server instance 的主机名。
  • 有关可以添加到任何搜索限定符以进一步改善结果的搜索语法列表,请参阅“了解搜索语法”。
  • 对多个字词的搜索词使用引号。 例如,如果要搜索具有标签 "In progress" 的议题,可搜索 label:"in progress"。 搜索不区分大小写。

Search within commit messages

You can find commits that contain particular words in the message. For example, fix typo matches commits containing the words "fix" and "typo."

Search by author or committer

You can find commits by a particular user with the author or committer qualifiers.

QualifierExample
author:USERNAMEauthor:defunkt matches commits authored by @defunkt.
committer:USERNAMEcommitter:defunkt matches commits committed by @defunkt.

The author-name and committer-name qualifiers match commits by the name of the author or committer.

QualifierExample
author-name:NAMEauthor-name:wanstrath matches commits with "wanstrath" in the author name.
committer-name:NAMEcommitter-name:wanstrath matches commits with "wanstrath" in the committer name.

The author-email and committer-email qualifiers match commits by the author's or committer's full email address.

QualifierExample
author-email:EMAILauthor-email:chris@github.com matches commits authored by chris@github.com.
committer-email:EMAILcommitter-email:chris@github.com matches commits committed by chris@github.com.

Search by authored or committed date

Use the author-date and committer-date qualifiers to match commits authored or committed within the specified date range.

搜索日期时,可以使用大于、小于和范围限定符来进一步筛选结果。 更多信息请参阅“了解搜索语法”。

QualifierExample
author-date:YYYY-MM-DDauthor-date:<2016-01-01 matches commits authored before 2016-01-01.
committer-date:YYYY-MM-DDcommitter-date:>2016-01-01 matches commits committed after 2016-01-01.

Filter merge commits

The merge qualifier filters merge commits.

QualifierExample
merge:truemerge:true matches merge commits.
merge:falsemerge:false matches non-merge commits.

Search by hash

The hash qualifier matches commits with the specified SHA-1 hash.

QualifierExample
hash:HASHhash:124a9a0ee1d8f1e15e833aff432fbb3b02632105 matches commits with the hash 124a9a0ee1d8f1e15e833aff432fbb3b02632105.

Search by parent

The parent qualifier matches commits whose parent has the specified SHA-1 hash.

QualifierExample
parent:HASHparent:124a9a0ee1d8f1e15e833aff432fbb3b02632105 matches children of commits with the hash 124a9a0ee1d8f1e15e833aff432fbb3b02632105.

Search by tree

The tree qualifier matches commits with the specified SHA-1 git tree hash.

QualifierExample
tree:HASHtree:99ca967 matches commits that refer to the tree hash 99ca967.

Search within a user's or organization's repositories

To search commits in all repositories owned by a certain user or organization, use the user or org qualifier. To search commits in a specific repository, use the repo qualifier.

QualifierExample
user:USERNAMEgibberish user:defunkt matches commit messages with the word "gibberish" in repositories owned by @defunkt.
org:ORGNAMEtest org:github matches commit messages with the word "test" in repositories owned by @github.
repo:USERNAME/REPOlanguage repo:defunkt/gibberish matches commit messages with the word "language" in @defunkt's "gibberish" repository.

Filter by repository visibility

The is qualifier matches commits from repositories with the specified visibility. For more information, see "About repositories."

QualifierExample
is:publicis:public matches commits to public repositories.
is:internalis:internal matches commits to internal repositories.

| is:private | is:private matches commits to private repositories.

Further reading

此文档对您有帮助吗?

隐私政策

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

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

做出贡献

或者, 了解如何参与。