| 1 | --- |
| 2 | title: Search and Explore |
| 3 | description: Search all of g1t at once (repositories, code, work items, pull requests, people and workspaces) with qualifiers, and browse public projects on Explore. |
| 4 | --- |
| 5 | |
| 6 | **Search** looks through all of g1t at once: repositories, the code on |
| 7 | their default branches, work items, pull requests, people and workspaces. It |
| 8 | covers everything public, and everything private in the workspaces you |
| 9 | belong to. Signed out, you see public results only. |
| 10 | |
| 11 | **Explore**, at [g1t.sh/explore](https://g1t.sh/explore), lists public |
| 12 | projects: the recently active ones, the new ones, and the ones in a |
| 13 | language or about a topic. |
| 14 | |
| 15 | ## Search from anywhere |
| 16 | |
| 17 | There are two ways in: |
| 18 | |
| 19 | | Where | What it does | |
| 20 | | --- | --- | |
| 21 | | **Search or jump to…** at the top of the sidebar, or **⌘K** (Ctrl-K on Windows and Linux) | Opens the command palette. As you type it shows matching repositories, work items, pull requests and people, the pages you can go to, and rows that search all of g1t (the full results at [g1t.sh/search](https://g1t.sh/search)) or only code for what you typed. On a phone, where the sidebar is folded away, the magnifier in the top bar opens it | |
| 22 | | A project's **Code** page | **Search this repository's code** searches the project's repository, with `repo:` filled in | |
| 23 | |
| 24 | The search page has a tab for each kind of result, each with its count: |
| 25 | |
| 26 | | Tab | Searches | |
| 27 | | --- | --- | |
| 28 | | **Repositories** | Each repository's name, workspace, its project's description, topics and the opening of its README | |
| 29 | | **Code** | The file names and contents of every repository's default branch | |
| 30 | | **Work items** | Work item titles and descriptions, in each workspace | |
| 31 | | **Pull requests** | Pull request titles and descriptions | |
| 32 | | **People** | Usernames and names of people, and the slugs, names and descriptions of workspaces | |
| 33 | |
| 34 | Results show the part that matched, highlighted. A code result shows the |
| 35 | lines that matched with their line numbers, and each line links to that |
| 36 | line of the file, at `/<owner>/<repo>/blob/<branch>/<path>#L<line>`. Counts |
| 37 | stop at 1,000. Results come 20 to a page. |
| 38 | |
| 39 | ## Writing a query |
| 40 | |
| 41 | Words match wherever they appear, in any order. A result has every word |
| 42 | you type. |
| 43 | |
| 44 | | You type | It finds | |
| 45 | | --- | --- | |
| 46 | | `merge queue` | Results with both words, anywhere | |
| 47 | | `"merge queue"` | The two words together, in this order | |
| 48 | | `parse -legacy` | Results with `parse` and without `legacy` | |
| 49 | | `pars` | In repositories, work items, pull requests and people, any word that starts with `pars`, such as `parser` | |
| 50 | | `parse_query(` | In code, that exact run of characters, punctuation and all | |
| 51 | |
| 52 | Code is matched as text, the way you would find something in an editor: |
| 53 | any run of three characters or more, inside words or across them. A code |
| 54 | search needs at least one word of three characters or more, unless it is |
| 55 | limited to repositories with `repo:`. |
| 56 | |
| 57 | ### Qualifiers |
| 58 | |
| 59 | Put qualifiers anywhere in the query. Most can be left out with a leading |
| 60 | `-`, such as `-label:wontfix`. |
| 61 | |
| 62 | | Qualifier | Narrows to | Applies to | |
| 63 | | --- | --- | --- | |
| 64 | | `repo:owner/name` | One repository. Give it more than once for several. A work item matches when the repository is linked to it, in any role | Repositories, code, work items, pull requests | |
| 65 | | `org:acme` or `workspace:acme` | One workspace | Repositories, code, work items, pull requests | |
| 66 | | `language:rust` | Code in a language, or repositories mostly written in it. `ts`, `js`, `py` and `cpp` are understood | Repositories, code | |
| 67 | | `path:src/` | Code whose path contains `src/`. With `*`, a pattern: `path:*.rs`, `path:src/*/mod.rs` | Code | |
| 68 | | `is:item` (or `is:items`), `is:pr` | Only work items, or only pull requests | Work items, pull requests | |
| 69 | | `is:open`, `is:closed` | Work items and pull requests by state | Work items, pull requests | |
| 70 | | `is:merged`, `is:draft` | Pull requests that were merged, or are still drafts | Pull requests | |
| 71 | | `is:public`, `is:private` | Results from public or private repositories | Repositories, code, work items, pull requests | |
| 72 | | `author:ana` | Opened by someone. What g1t opened is `author:g1t`, and shows who it was for | Work items, pull requests | |
| 73 | | `label:bug` | With a label. Quote a label with spaces: `label:"good first issue"` | Work items, pull requests | |
| 74 | | `type:code` | Which tab to open: `repositories`, `code`, `items`, `pulls` or `people` | All | |
| 75 | |
| 76 | Without a tab or `type:`, the qualifiers choose one: `path:` opens Code, |
| 77 | `is:pr` opens Pull requests, `is:open`, `author:` or `label:` open Work items, |
| 78 | and anything else opens Repositories. A qualifier that only one kind of |
| 79 | result has rules the others out: a query with `path:` finds no people. |
| 80 | |
| 81 | Some examples: |
| 82 | |
| 83 | ```text |
| 84 | fetchEvents language:typescript path:app/ |
| 85 | "rate limit" org:acme is:item is:open |
| 86 | crash author:ana -label:wontfix |
| 87 | router repo:acme/web repo:acme/api |
| 88 | ``` |
| 89 | |
| 90 | ## What is indexed |
| 91 | |
| 92 | Search is kept current as things change: |
| 93 | |
| 94 | | What | When it is indexed | |
| 95 | | --- | --- | |
| 96 | | A repository's name, topics and README | When it is created or its settings change, and on every push to its default branch | |
| 97 | | A repository's description, which is its project's | When the project's name or description changes | |
| 98 | | Code | On every push to the default branch: only the files the push changed | |
| 99 | | Work items and pull requests | When they are opened, edited, assigned, closed, reopened, marked ready or merged; a work item also when a repository is linked to it or unlinked | |
| 100 | | People and workspaces | When an account or a workspace is made, or its name, description or avatar changes | |
| 101 | |
| 102 | Code is indexed from default branches only. Some files are left out: |
| 103 | |
| 104 | - vendored and generated directories, such as `node_modules`, `vendor`, |
| 105 | `third_party`, `dist`, `target` and `.next`; |
| 106 | - lockfiles, such as `package-lock.json`, `pnpm-lock.yaml`, `Cargo.lock` |
| 107 | and `go.sum`; |
| 108 | - binary files (images, fonts, archives, compiled code) and minified files; |
| 109 | - files larger than 512 KB. |
| 110 | |
| 111 | A push that changes more than 300 files has the whole default branch |
| 112 | compared instead, and files are read a few dozen at a time in the |
| 113 | background, so very large pushes appear in search over a few minutes. A |
| 114 | repository's first 5,000 files are indexed. |
| 115 | |
| 116 | Set a repository's **topics** in **Settings → Repository**. Topics show on |
| 117 | the project's page and in search results, and each opens Explore for that |
| 118 | topic. |
| 119 | |
| 120 | ## Who sees what |
| 121 | |
| 122 | Search shows you exactly what you could open yourself: |
| 123 | |
| 124 | - Public repositories, and their code and pull requests, are shown to |
| 125 | everyone, signed in or not. |
| 126 | - Private repositories, and their code and pull requests, are shown only |
| 127 | to people with a [role](/guides/access-and-roles/) on them, and to the |
| 128 | coding agents they connect, which search as them. |
| 129 | - A work item is shown to the members of its workspace, and to anyone who |
| 130 | can read the repository it was filed in (its origin). One filed in a |
| 131 | public repository is shown to everyone; one with no origin only to |
| 132 | members. See [who sees a work item](/work/work-items/#who-sees-a-work-item). |
| 133 | - People and workspaces are public, as their pages are. Search never shows |
| 134 | which workspaces someone belongs to. |
| 135 | |
| 136 | Visibility is checked when you search, against your memberships, the |
| 137 | roles you were given on repositories, and each repository's visibility as |
| 138 | they are at that moment, not as they were when something was indexed. A |
| 139 | repository made private disappears from everyone else's results at once; |
| 140 | one made public appears in them within moments. Someone removed from a |
| 141 | workspace, or whose role on a repository is taken away, stops seeing its |
| 142 | private results on their next search. |
| 143 | |
| 144 | ## Explore |
| 145 | |
| 146 | [Explore](https://g1t.sh/explore) lists public projects only: |
| 147 | |
| 148 | | View | Shows | |
| 149 | | --- | --- | |
| 150 | | **Recently active** | Projects by their last push to the default branch | |
| 151 | | **New** | Projects by when they were created | |
| 152 | | **Languages** | The languages public projects are mostly written in, with how many; choose one to see its projects | |
| 153 | | **Topics** | The topics public projects have, with how many; choose one to see its projects | |
| 154 | |
| 155 | A project's language is the one most of its indexed code is written in, |
| 156 | leaving out prose and data such as Markdown, JSON and YAML. An |
| 157 | [archived](/guides/managing-repositories/#archive-a-repository) project is |
| 158 | still listed, labeled **archived**. |
| 159 | |
| 160 | ## From the API and agents |
| 161 | |
| 162 | The same search is `GET /search` in the API and the `search` tool over |
| 163 | MCP, whose default action is `code`. It takes `q` (the query), `type` and `page`, and needs no token for |
| 164 | public results: |
| 165 | |
| 166 | ```sh |
| 167 | curl "https://api.g1t.sh/search?q=parse_query+language:rust&type=code" |
| 168 | ``` |
| 169 | |
| 170 | With a token, private results in your workspaces are included. See |
| 171 | [Search g1t](/reference/api/search/search/) in the API reference and |
| 172 | [MCP tools](/reference/mcp/#search). |