Comprehensive Guide to GitHub Search Syntax and Techniques
This article provides a detailed overview of GitHub's advanced search capabilities, including sorting options, repository, code, user, and topic search qualifiers, with numerous examples and practical tips for developers to locate and rank results effectively.
GitHub's search functionality goes beyond simple keyword matching and supports a rich set of qualifiers and sorting options.
The information below is based on the official GitHub documentation (https://docs.github.com/en).
2. Sorting Search Results
2.1. Sort by Interactions
Syntax
Example
org:github sort:interactionsMatch issues in GitHub-owned repositories and sort by the highest combined number of reactions and comments.
org:github sort:interactions-ascMatch issues in GitHub-owned repositories and sort by the lowest combined number of reactions and comments.
2.2. Sort by Reactions
Syntax
Example
org:github sort:reactionsMatch issues in GitHub-owned repositories and sort by the highest number of reactions.
org:github sort:reactions-ascSort by reaction count in ascending order (fewest to most).
org:github sort:reactions-+1Sort by the most +1 (👍) reactions.
org:github sort:reactions--1Sort by the most -1 (👎) reactions.
org:github sort:reactions-smileSort by the most smile (😄) reactions.
org:github sort:reactions-tadaSort by the most celebration (🎉) reactions.
org:github sort:reactions-heartSort by the most heart (❤️) reactions.
2.3. Sort by Author Date
Syntax
Example
org:github sort:author-date featureMatch commits containing the word "feature" and sort by author date descending.
org:github sort:author-date-asc featureMatch commits containing the word "feature" and sort by author date ascending.
2.4. Sort by Committer Date
Syntax
Example
org:github sort:committer-dateMatch commits containing the word "feature" and sort by committer date descending.
org:github sort:committer-date-ascMatch commits containing the word "feature" and sort by committer date ascending.
2.5. Sort by Updated Date
Syntax
Example
sort:updated featureMatch repositories containing "feature" and sort by most recent update.
sort:updated-asc featureMatch repositories containing "feature" and sort by oldest update first.
3. Search Scope
3.1. Search Repositories
3.1.1. By Repository Name, Description, or README
Syntax
Example
in:name jqueryMatch repositories with "jquery" in the name.
in:description jqueryMatch repositories with "jquery" in the description.
in:readme jqueryMatch repositories whose README mentions "jquery".
3.1.2. Within a User or Organization's Repositories
Syntax
Example
user:defunkt forks:>100Match repositories owned by user "defunkt" with more than 100 forks.
3.1.3. By Repository Size
Syntax
Example
size:1000Match repositories of exactly 1 MB.
size:>=30000Match repositories of at least 30 MB.
size:<50Match repositories smaller than 50 KB.
size:50…120Match repositories between 50 KB and 120 KB.
3.1.4. By Fork Count
Syntax
Example
forks:5Match repositories with exactly five forks.
forks:>=205Match repositories with at least 205 forks.
forks:<90Match repositories with fewer than 90 forks.
forks:10…20Match repositories with 10 to 20 forks.
3.1.5. By Star Count
Syntax
Example
stars:500Match repositories with exactly 500 stars.
stars:10…20Match repositories with 10 to 20 stars.
stars:>=500 fork:true language:phpMatch repositories with at least 500 stars, that are forks, and written in PHP.
3.1.6. By Creation or Last Update Time
Syntax
Example
webos created:<2011-01-01Match repositories containing "webos" created before 2011.
css push:>2013-02-01Match repositories containing "css" pushed after February 1 2013.
case push:>=2013-03-06 fork:onlyMatch repositories containing "case" pushed on or after March 6 2013 that are forks.
3.1.7. By Language
Syntax
Example
rails language:javascriptMatch repositories with the word "rails" written in JavaScript.
3.1.8. By Topic
Syntax
Example
topic:jekyllMatch repositories classified under the topic "jekyll".
3.1.9. By Number of Topics
Syntax
Example
topic:5Match repositories with exactly five topics.
topic:>3Match repositories with more than three topics.
3.1.10. By License
Syntax
Example
license:apache-2.0Match repositories licensed under Apache 2.0.
3.1.11. By Repository Visibility
Syntax
Example
is:public org:githubMatch public repositories owned by GitHub.
is:internal testMatch internal repositories you can access that contain the word "test".
is:private pagesMatch private repositories you can access that contain the word "pages".
3.1.12. By Mirror Status
Syntax
Example
mirror:true GNOMEMatch repositories that are mirrors and contain "GNOME".
mirror:false GNOMEMatch repositories that are not mirrors but contain "GNOME".
3.2. Search Topics
3.2.1. Narrow Search with Topic Qualifiers
Syntax
Example
is:curated javascriptMatch curated topics that contain "javascript".
is:featured javascriptMatch featured topics on https://github.com/topics/ that contain "javascript".
is:not-curated javascriptMatch topics without extra info (e.g., description or logo) that contain "javascript".
is:not-featured javascriptMatch topics that are not featured and contain "javascript".
repositories:>5000Match topics with more than 5 000 repositories.
3.3. Search Code
3.3.1. By File Content or Path
Syntax
Example
octocat in:fileMatch code where the file content contains "octocat".
octocat in:pathMatch code where the file path contains "octocat".
3.3.2. In a User or Organization's Repositories
Syntax
Example
user:defunkt extension:rbMatch Ruby files (.rb) in repositories owned by @defunkt.
org:github extension:jsMatch JavaScript files (.js) in repositories owned by GitHub.
repo:mozilla/shumway extension:asMatch ActionScript files (.as) in the Mozilla/Shumway project.
3.3.3. By Language
Syntax
Example
element language:xml size:100Match XML files of exactly 100 bytes containing the word "element".
display language:scssMatch SCSS code containing the word "display".
org:mozilla language:markdownMatch Markdown code in any Mozilla repository.
3.3.4. By File Size
Syntax
Example
function size:>10000 language:pythonMatch Python files larger than 10 KB that contain the word "function".
3.3.5. By Filename
Syntax
Example
filename:linguistMatch files named "linguist".
filename:.vimrc commandsMatch .vimrc files that contain the word "commands".
3.4. Search Users
3.4.1. By Account Name, Full Name, or Public Email
Syntax
Example
user:octocatMatch a user with the username "octocat".
org:electron type:usersMatch accounts belonging to the Electron organization.
kenya in:loginMatch users whose login contains "kenya".
bolton in:nameMatch users whose real name contains "bolton".
fullname:Nat FriedmanMatch a user with the full name "Nat Friedman" (space‑sensitive).
data in:emailMatch users whose public email contains "data".
3.4.2. By Number of Repositories Owned
Syntax
Example
repos:>9000Match users with more than 9 000 repositories.
bert repos:10…30Match users whose name or real name contains "bert" and who own 10 to 30 repositories.
3.4.3. By Account Creation Date
Syntax
Example
created:<2011-01-01Match users who joined before 2011.
created:>=2013-05-11Match users who joined on or after May 11 2013.
created:2013-03-06 location:londonMatch users who joined on March 6 2013 and list London as their location.
created:2010-01-01…2011-01-01 john in:loginMatch users who joined between 2010 and 2011 and have "john" in their username.
3.4.4. By Follower Count
Syntax
Example
followers:>=1000Match users with 1 000 or more followers.
sparkle follower:1…10Match users with 1 to 10 followers whose name contains "sparkle".
Backend Exclusive Technical Group
Build a high‑quality technical community; developers, recruiting HR, and anyone willing to share internal referrals are welcome to join and help each other improve.
Civilized discussion should focus on 交流技术 , 职位内推 , and 行业探讨 .
Advertisers are not allowed; do not trust private messages to avoid scams.
Add me as a friend and I will invite you to the group.
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.