| 1 | --- |
| 2 | title: How g1t works |
| 3 | description: How Code works on g1t, and how issues, pull requests, checks, review, merging and sessions fit together, for people and coding agents alike. |
| 4 | --- |
| 5 | |
| 6 | A workspace holds your repositories, with issues, pull requests, required |
| 7 | checks and the merge queue; [Actions](/guides/actions/) that run your |
| 8 | workflows; [Deployments](/guides/deployments/) that put every pull request |
| 9 | live; and [Chat](/guides/chat/) for your team. This page is about |
| 10 | **Code**, where changes are made and landed. |
| 11 | |
| 12 | Underneath is ordinary git: clone, branch, commit, push and pull work as |
| 13 | they do anywhere. On top of it are the two things you already know, |
| 14 | **issues** and **pull requests**, built so that many people and coding |
| 15 | agents can work at once without getting in each other's way. |
| 16 | |
| 17 | The coding agents you already use, such as Claude Code, Codex, Cursor or |
| 18 | OpenCode, work on g1t from wherever they run. They connect over |
| 19 | [MCP](/guides/bring-your-own-agent/), the [g1t CLI](/guides/cli/), the |
| 20 | [REST API](/reference/api/) and [webhooks](/guides/webhooks/), act as the |
| 21 | person who connected them, and go through the same pull requests, checks, |
| 22 | reviews and rules as everyone else. |
| 23 | |
| 24 | | | What it is | |
| 25 | | --- | --- | |
| 26 | | **Issue** | What should change: a bug, a feature, a question. | |
| 27 | | **Pull request** | A proposed change, on a branch or in a working copy of its own. Usually made for an issue. | |
| 28 | | **Session** | One run of a coding agent: its prompts, reasoning and tool calls, tied to the issue and pull request it worked on. | |
| 29 | |
| 30 | One issue can have several pull requests, each from a different person or |
| 31 | agent, and g1t keeps track of which one was merged. |
| 32 | |
| 33 | ## Issues |
| 34 | |
| 35 | An issue says what should change in a repository. People open them, |
| 36 | coding agents open them, and so can anything with an access token, such |
| 37 | as an error tracker reporting a crash. |
| 38 | |
| 39 | An issue has: |
| 40 | |
| 41 | - a **title** and a **description** in Markdown. Whoever works on the |
| 42 | issue, person or agent, works from this text. Say what done means in |
| 43 | plain words, under a `## Definition of done` heading if you like: it is |
| 44 | context for whoever works on it and its reviewers, not something a merge |
| 45 | waits on; |
| 46 | - **labels**, which say what kind of issue it is; |
| 47 | - **comments** and **assignees**; |
| 48 | - a **state**: open or closed. A closed issue records why: `completed` or |
| 49 | `not_planned`. |
| 50 | |
| 51 | Issues and pull requests share one sequence of numbers per repository, so |
| 52 | `#12` names exactly one of them. |
| 53 | |
| 54 | A new repository starts with a set of labels such as `bug`, |
| 55 | `enhancement` and `question`; anyone with the Triage role can make more as |
| 56 | they label. An issue or pull request carries up to 20. See |
| 57 | [labels](/guides/labels/). |
| 58 | |
| 59 | ## Pull requests |
| 60 | |
| 61 | A pull request is a proposed change. There are two ways to make one. |
| 62 | |
| 63 | **From a branch.** Push a branch to the repository, then open a pull |
| 64 | request from it on the **Pull requests** tab or with `g1t pr create`. It |
| 65 | needs write access to the repository, and is ready for review as soon as |
| 66 | it is opened. |
| 67 | |
| 68 | **In a working copy.** This is how coding agents usually work: the |
| 69 | `pull_request` tool's `create` action, or `g1t pr create --issue 12` with |
| 70 | no branch of your own, opens a draft pull request for an issue and makes |
| 71 | it a copy of the repository that belongs to that pull request alone, |
| 72 | ready in about the time a branch would be. The author clones it, commits |
| 73 | and pushes to it, and nothing they do can touch `main` or another pull |
| 74 | request. It lives at `g1t.sh/pulls/<pull request id>.git` and is exactly |
| 75 | as visible as the repository it came from. |
| 76 | |
| 77 | [Forks and working copies](/concepts/forks/) explains when each is the |
| 78 | better choice. |
| 79 | |
| 80 | | Status | Meaning | |
| 81 | | --- | --- | |
| 82 | | `draft` | Still being worked on. A pull request in a working copy starts here. | |
| 83 | | `open` | Ready for review, with a description of what changed and why. | |
| 84 | | `merged` | Landed on its base branch. | |
| 85 | | `closed` | Closed without merging. | |
| 86 | |
| 87 | A pull request is normally opened **for an issue**. It can also stand |
| 88 | alone, with its own title, for a change nobody filed an issue about. |
| 89 | |
| 90 | ## Assignees and reviewers |
| 91 | |
| 92 | Issues and pull requests have assignees, and pull requests have |
| 93 | reviewers: the people and teams whose review was asked for. Each shows |
| 94 | beside the conversation, with where every reviewer stands. |
| 95 | |
| 96 | Assigning an issue to `g1t`, or mentioning `@g1t` in a comment, starts a |
| 97 | session on the workspace's own Anthropic account, as the person who asked; |
| 98 | see [Assign g1t](/guides/sessions/#assign-g1t-or-ask-it-in-the-thread). |
| 99 | |
| 100 | The conversation tells what happened, in order, between the comments: who |
| 101 | assigned whom, whose review was asked for, which sessions started, and |
| 102 | when it was marked ready, merged or closed. |
| 103 | |
| 104 | ## Several pull requests for one issue |
| 105 | |
| 106 | An issue can have more than one pull request: a second attempt after the |
| 107 | first fell short, or two agents trying different approaches. Each has its |
| 108 | own branch or working copy, its own session and its own diff. The issue's |
| 109 | page lists them all with their status. |
| 110 | |
| 111 | When you merge one: |
| 112 | |
| 113 | - the pull request becomes `merged`, recording who merged it and when; |
| 114 | - the issue closes as `completed`, and records that pull request as the one |
| 115 | that **resolved** it; |
| 116 | - every other pull request for that issue that was still a draft or open is |
| 117 | closed, marked as **superseded** by the one that was merged. |
| 118 | |
| 119 | So the answer to "which one did we take?" is on the issue, on the merged |
| 120 | pull request, and on each one that was passed over. |
| 121 | |
| 122 | When several pull requests each do part of an issue, say that the issue |
| 123 | should stay open as you merge. The pull request merges, and the issue and |
| 124 | the other pull requests are left as they are. |
| 125 | |
| 126 | ## Checks |
| 127 | |
| 128 | A pull request's checks are what the repository's |
| 129 | [workflows](/guides/actions/) and integrations report on its head commit. |
| 130 | Every workflow that runs on `pull_request` runs on every pull request, |
| 131 | whoever opened it, and reports a check named after the workflow, such as |
| 132 | `CI`. |
| 133 | |
| 134 | The base branch decides which checks a merge needs: its |
| 135 | [required status checks](/guides/pull-requests/#required-status-checks). |
| 136 | A pull request merges only once each of them has passed on its head. One |
| 137 | that failed, is still running or has not reported yet holds the merge, |
| 138 | unless the repository allows bypassing them and someone who can merge |
| 139 | chooses to. Checks that are not required are shown, and never hold a merge. |
| 140 | |
| 141 | The same rules hold for people and agents. A pull request an agent opens |
| 142 | is checked by the same workflows as yours, and an agent cannot mark its |
| 143 | own work as passing: only the checks report. |
| 144 | |
| 145 | ## Review |
| 146 | |
| 147 | Anyone who can see a pull request can comment on it, on the whole of it or |
| 148 | on a single line of its change, in **Files changed**. |
| 149 | |
| 150 | A reviewer can also give a verdict: **approve**, or **request changes**. |
| 151 | You cannot give a verdict on a pull request you opened, and neither can a |
| 152 | coding agent working as you. |
| 153 | |
| 154 | ## Overlap |
| 155 | |
| 156 | When many changes are in flight, some touch the same files. g1t tracks |
| 157 | which files each pull request changes, from every push, and shows on a |
| 158 | pull request which others in progress change the same ones. |
| 159 | |
| 160 | Two pull requests for the *same* issue are expected to overlap: they are |
| 161 | alternatives, and one will be merged. Two for *different* issues are |
| 162 | heading for a conflict, and g1t says so while the work is still going on, |
| 163 | not when the second one tries to merge. Agents get the same list from the |
| 164 | `pull_request` tool's `get` action, as `overlaps`, so they can keep their |
| 165 | edits small where they must touch the same files. |
| 166 | |
| 167 | ## Merging |
| 168 | |
| 169 | Someone with the [Write role](/guides/access-and-roles/) or higher merges |
| 170 | a pull request once it is ready and its |
| 171 | [required checks](/guides/pull-requests/#required-status-checks) have |
| 172 | passed. It lands by one of the repository's |
| 173 | [merge methods](/guides/pull-requests/#merge-methods): a merge commit, a |
| 174 | squash, a rebase or a fast-forward. In a repository that uses |
| 175 | [the merge queue](/guides/merge-queue/), merging adds it to the queue |
| 176 | instead. **Auto-merge** lands it by itself once everything it needs is met. |
| 177 | |
| 178 | When something else landed first, the pull request is **behind**, and its |
| 179 | page says so. Merging brings it up to date and lands it, unless the |
| 180 | repository requires pull requests to be up to date first; then merging |
| 181 | waits until it has caught up. |
| 182 | |
| 183 | **Update branch** brings it up to date. When the two sides' changes do |
| 184 | not clash (edits to the same file merge line by line), g1t merges or |
| 185 | rebases the base in itself in a few seconds, and the workflows run again |
| 186 | ([keeping it up to date](/guides/pull-requests/#keeping-it-up-to-date)). |
| 187 | When they changed the same lines, pull the base into the branch or |
| 188 | working copy, resolve, and push. The base never loses a commit this way, |
| 189 | however many pull requests are in flight. |
| 190 | |
| 191 | ## The merge queue |
| 192 | |
| 193 | Merging one pull request at a time keeps every merge clean as text, but |
| 194 | two changes can merge without a conflict and still break each other. A |
| 195 | repository whose rules include **Require the merge queue** (**Settings → |
| 196 | Rules**) tests each pull request together with the ones ahead of it, and |
| 197 | the base only moves to a state whose required checks passed. When one |
| 198 | fails in combination, g1t says which pull requests and which check, so its |
| 199 | author, person or agent, can fix it. See [merge queue](/guides/merge-queue/). |
| 200 | |
| 201 | ## Sessions and why-blame |
| 202 | |
| 203 | A session is one run of a coding agent: the prompts it was given, its |
| 204 | reasoning, the tools it called, and what it touched. g1t's |
| 205 | [Claude Code plugin](/guides/claude-code-plugin/) records one for every |
| 206 | Claude Code session in a g1t repository; other agents record theirs with |
| 207 | the `session` tool or `g1t session`. A session is tied to the issue it |
| 208 | claimed and the pull request it opened, and people read it on the pull |
| 209 | request's **Session** tab and on the repository's **Work** page, which |
| 210 | shows who is working on what right now. See |
| 211 | [sessions, claims and dependencies](/guides/sessions/). |
| 212 | |
| 213 | Each entry is tied to the commit that was the head when it was recorded, |
| 214 | so **Blame** on any file can show not only the commit that last changed a |
| 215 | line, but the pull request and issue it came from and the agent's own |
| 216 | account of the change. See [sessions and why-blame](/guides/why-blame/). |
| 217 | |
| 218 | ## Events |
| 219 | |
| 220 | Every state change in g1t is published as an event: a push, an issue being |
| 221 | opened, a pull request being merged, a session growing. Events reach the |
| 222 | services that react to them, your [webhooks](/guides/webhooks/), and a |
| 223 | timeline per repository that you can read through the |
| 224 | [API](/reference/api/) or follow with `g1t work events --follow`. |
| 225 | [Events](/architecture/events/) in the Architecture section shows how. |
| 226 | |
| 227 | ## What is not built yet |
| 228 | |
| 229 | Every current limit, and why, is on |
| 230 | [What g1t can't do yet](/about/limitations/). |