Github Search Syntax Cheat Sheet

A Software › Nope cheat sheet in English by cpriest

Quick Reference for Github Search Syntax

41,053 views 6,570 downloads 15 Aug 2021 History

Search Syntax

Operators
Notes
<, <=, >, >=
Value compar­isons
n..*, *..n, n..n
Range compar­isons
NOT QUALIFIER
-QUALIFIER
Exclude the qualifier
"­dou­ble­-qu­ote­s"
Surrounds white-­space phrases
All query inputs are ANDed together, so "cats dogs" as the search input would match anywhere in the title, body or comment which had both "­cat­s" AND "­dog­s" in the match.

Dates follow ISO8601 such as (year-­mon­th-day)

Limit Results (General)

Prefix
Qualifier
is:, type:
pr, issue, public, private
in:
title, body, comments, name, descri­ption, readme
user:, org:
NAME, @me
repo:
USER/REPO
author:
USER, app/name, @me
language:
LANG
no:
label, milestone, assignee, project
size:
size of target matches range qualifier
followers:
forks:
stars:
topics:

target matches range qualifier
topic:
matches targets which have the topic

Code Search

Qualifier
Searches files...
path:DIRECTORY
with DIRECTORY in the file path
language:LANGUAGE
which are of LANGUAGE, see languages
size:n
which match the n range qualifier
filename:FILENAME
which match FILENAME
extension:EXTENSION
which match EXTENSION
Examples
octocat filena­me:­readme path:/ matches readme files with the word octocat that are located at the root level of a reposi­tory.
form path:c­gi-bin langua­ge:perl matches Perl files with the word form in a cgi-bin directory, or in any of its subdir­ect­ories
Hello langua­ge:­mar­kdown -filen­ame­:readme matches Markdown files with the word Hello excluding files named readme

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.