You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/search-github/searching-on-github/searching-in-forks.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,20 +13,30 @@ versions:
13
13
14
14
To show forks in repository search results, add `fork:true` or `fork:only` to your query. For more information, see [AUTOTITLE](/search-github/searching-on-github/searching-for-repositories).
15
15
16
-
{% ifversion ghes %}Forks are only indexed for 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 code search results, add `fork:true` or `fork:only` to your query. For more information, see [AUTOTITLE](/search-github/searching-on-github/searching-code).{% endif %}
16
+
{% ifversion ghes %}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 [AUTOTITLE](/search-github/searching-on-github/searching-code).{% endif %}
17
17
18
18
> [!NOTE]
19
19
> Forks can only be included in repository and code searches.
20
20
21
+
## Repository search
22
+
21
23
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.
22
24
23
25
| Qualifier | Example
24
26
| ------------- | -------------
25
27
| `fork:true` | [**github fork:true**](https://github.com/search?q=github+fork%3Atrue&type=Repositories) matches all repositories containing the word "github," including forks.
26
-
| <code>language:<em>LANGUAGE</em></code> `fork:true` | [**android language:java fork:true**](https://github.com/search?q=android+language%3Ajava+fork%3Atrue&type=Code) matches code with the word "android" that's written in Java, in both forks and regular repositories.
27
28
| `fork:only` | [**github fork:only**](https://github.com/search?q=github+fork%3Aonly&type=Repositories) matches all fork repositories containing the word "github."
28
29
| <code>forks:><em>n</em></code> `fork:only` | [**forks:>500 fork:only**](https://github.com/search?q=forks%3A%3E500+fork%3Aonly&type=Repositories) matches repositories with more than 500 forks, and only returns those that are forks.
29
30
31
+
## Code search
32
+
33
+
{% data variables.product.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`.{% ifversion code-search-upgrade %} For more information, see [AUTOTITLE](/search-github/github-code-search/understanding-github-code-search-syntax).{% endif %}
34
+
35
+
| Qualifier | Example
36
+
| ------------- | -------------
37
+
| `is:fork` | [**android language:java is:fork**](https://github.com/search?q=android+language%3Ajava+is%3Afork&type=code) matches code with the word "android" that's written in Java, in forked repositories.
38
+
| `NOT is:fork` | [**android language:java NOT is:fork**](https://github.com/search?q=android+language%3Ajava+NOT+is%3Afork&type=code) matches code with the word "android" that's written in Java, excluding forked repositories.
0 commit comments