To show forks in repository search results, add fork:true or fork:only to your query. For more information, see Searching for repositories.
Forks are only indexed for legacy code search when they have more stars than the parent repository. You will not be able to search the code in a fork that has fewer stars than its parent. To show forks with more stars than the parent repository in legacy code search results, add fork:true or fork:only to your query. For more information, see Searching code.
Note
Forks can only be included in repository and code searches.
Repository search
The fork:true qualifier finds all results that match your search query, including forks. The fork:only qualifier finds only forks that match your search query.
| Qualifier | Example |
|---|---|
fork:true | github fork:true matches all repositories containing the word "github," including forks. |
fork:only | github fork:only matches all fork repositories containing the word "github." |
forks:>n fork:only | forks:>500 fork:only matches repositories with more than 500 forks, and only returns those that are forks. |
Code search
GitHub code search uses is:fork instead of fork:true to include forked repositories in code search results. To exclude forks, use NOT is:fork.
| Qualifier | Example |
|---|---|
is:fork | android language:java is:fork matches code with the word "android" that's written in Java, in forked repositories. |
NOT is:fork | android language:java NOT is:fork matches code with the word "android" that's written in Java, excluding forked repositories. |