.nh .TH "GH-SEARCH-COMMITS" "1" "Feb 2023" "" "GitHub CLI manual" .SH NAME .PP gh-search-commits - Search for commits .SH SYNOPSIS .PP \fB\fCgh search commits [] [flags]\fR .SH DESCRIPTION .PP Search for commits on GitHub. .PP The command supports constructing queries using the GitHub search syntax, using the parameter and qualifier flags, or a combination of the two. .PP GitHub search syntax is documented at: https://docs.github.com/search-github/searching-on-github/searching-commits \[la]https://docs.github.com/search-github/searching-on-github/searching-commits\[ra] .SH OPTIONS .TP \fB\fC--author\fR \fB\fC\fR Filter by author .TP \fB\fC--author-date\fR \fB\fC\fR Filter based on authored date .TP \fB\fC--author-email\fR \fB\fC\fR Filter on author email .TP \fB\fC--author-name\fR \fB\fC\fR Filter on author name .TP \fB\fC--committer\fR \fB\fC\fR Filter by committer .TP \fB\fC--committer-date\fR \fB\fC\fR Filter based on committed date .TP \fB\fC--committer-email\fR \fB\fC\fR Filter on committer email .TP \fB\fC--committer-name\fR \fB\fC\fR Filter on committer name .TP \fB\fC--hash\fR \fB\fC\fR Filter by commit hash .TP \fB\fC-q\fR, \fB\fC--jq\fR \fB\fC\fR Filter JSON output using a jq expression .TP \fB\fC--json\fR \fB\fC\fR Output JSON with the specified fields .TP \fB\fC-L\fR, \fB\fC--limit\fR \fB\fC\fR Maximum number of commits to fetch .TP \fB\fC--merge\fR Filter on merge commits .TP \fB\fC--order\fR \fB\fC\fR Order of commits returned, ignored unless '--sort' flag is specified: {asc|desc} .TP \fB\fC--owner\fR \fB\fC\fR Filter on repository owner .TP \fB\fC--parent\fR \fB\fC\fR Filter by parent hash .TP \fB\fC--repo\fR \fB\fC\fR Filter on repository .TP \fB\fC--sort\fR \fB\fC\fR Sort fetched commits: {author-date|committer-date} .TP \fB\fC-t\fR, \fB\fC--template\fR \fB\fC\fR Format JSON output using a Go template; see "gh help formatting" .TP \fB\fC--tree\fR \fB\fC\fR Filter by tree hash .TP \fB\fC--visibility\fR \fB\fC\fR Filter based on repository visibility: {public|private|internal} .TP \fB\fC-w\fR, \fB\fC--web\fR Open the search query in the web browser .SH EXAMPLE .PP .RS .nf # search commits matching set of keywords "readme" and "typo" $ gh search commits readme typo # search commits matching phrase "bug fix" $ gh search commits "bug fix" # search commits committed by user "monalisa" $ gh search commits --committer=monalisa # search commits authored by users with name "Jane Doe" $ gh search commits --author-name="Jane Doe" # search commits matching hash "8dd03144ffdc6c0d486d6b705f9c7fba871ee7c3" $ gh search commits --hash=8dd03144ffdc6c0d486d6b705f9c7fba871ee7c3 # search commits authored before February 1st, 2022 $ gh search commits --author-date="<2022-02-01" .fi .RE .SH SEE ALSO .PP \fB\fCgh-search(1)\fR