Skip to content

Instantly share code, notes, and snippets.

@bonniss
Last active April 23, 2024 15:22
Show Gist options
  • Star 43 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save bonniss/4f0de4f599708c5268134225dda003e0 to your computer and use it in GitHub Desktop.
Save bonniss/4f0de4f599708c5268134225dda003e0 to your computer and use it in GitHub Desktop.
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

This search Finds repositories with…
cat stars:>100 Find cat repositories with greater than 100 stars.
user:defunkt Get all repositories from the user defunkt.
tom location:"San Francisco, CA" Find all tom users in "San Francisco, CA".
join extension:coffee Find all instances of join in code with coffee extension.
NOT cat Excludes all results containing cat.

Repository search

Repository search looks through the projects you have access to on GitHub. You can also filter the results:

This search Finds repositories with…
cat stars:>100 Find cat repositories with greater than 100 stars.
user:defunkt Get all repositories from the user defunkt.
pugs pushed:>2013-01-28 Pugs repositories pushed to since Jan 28, 2013.
node.js forks:<200 Find all node.js repositories with less than 200 forks.
jquery size:1024..4089 Find jquery repositories between the sizes 1024 and 4089 kB.
gitx fork:true Repository search includes forks of gitx.
gitx fork:only Repository search returns only forks of gitx.

Code search

Code search looks through the files hosted on GitHub. You can also filter the results:

This search Finds repositories with…
install repo:charles/privaterepo Find all instances of install in code from the repository charles/privaterepo.
shogun user:heroku Find references to shogun from all public heroku repositories.
join extension:coffee Find all instances of join in code with coffee extension.
system size:>1000 Find all instances of system in code of file size greater than 1000kbs.
examples path:/docs/ Find all examples in the path /docs/.
replace fork:true Search replace in the source code of forks.

Issue search

Issue search looks through issues and pull requests on GitHub. You can also filter the results:

This search Finds issues…
encoding user:heroku Encoding issues across the Heroku organization.
cat is:open Find cat issues that are open.
strange comments:>42 Issues with more than 42 comments.
hard label:bug Hard issues labeled as a bug.
author:mojombo All issues authored by mojombo.
mentions:tpope All issues mentioning tpope.
assignee:rtomayko All issues assigned to rtomayko.
exception created:>2012-12-31 Created since the beginning of 2013.
exception updated:<2013-01-01 Last updated before 2013.

User search

User search finds users with an account on GitHub. You can also filter the results:

This search Finds repositories with…
fullname:"Linus Torvalds" Find users with the full name "Linus Torvalds".
tom location:"San Francisco, CA" Find all tom users in "San Francisco, CA".
chris followers:100..200 Find all chris users with followers between 100 and 200.
ryan repos:>10 Find all ryan users with more than 10 repositories.
@sengiv
Copy link

sengiv commented Mar 10, 2023

add cat language:c# = all .cs files with "cat"

@ishaan812
Copy link

Thanks for the cheatsheet, appreciate it!

@QGB
Copy link

QGB commented Jul 19, 2023

How to filter file size in github search?

eg. How to find size:>500KB .txt file ?

@QGB
Copy link

QGB commented Jul 19, 2023

724 files
 (300 ms)
724 files
Possible unrecognized qualifier, searching for this term literally
size:1024..4089

@RupertBarrow
Copy link

Thanks for this 👍

@ahsan-abc
Copy link

really appreciate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment