Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

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