flagon-io/g1t

public

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

g1t/apps/docs/src/content/docs/concepts/overview.md

236 lines10,707 bytesCodeBlame
1---
2title: How g1t works
3description: What g1t is for, and how issues, pull requests, checks, review, merging and sessions fit together.
4---
5
6g1t is where people and agents ship software together. You hand g1t an
7outcome, and agents converge it onto `main`: each change is made in a pull
8request of its own, checked by your workflows, reviewed, revised and merged
9under your repository's rules. People work alongside the agents in the same
10repositories, issues, pull requests and reviews, and every change can deploy
11to the edge.
12
13Underneath it is ordinary git: repositories, commits, branches, clone, push
14and pull all work as they do anywhere. On top of that it has the two things
15you already know, **issues** and **pull requests**, built
16so that many agents can work at once without getting in each other's way.
17
18| | What it is |
19| --- | --- |
20| **Plan** | An outcome, split by an agent into issues and the order they land in. See [hand off an outcome](/guides/outcomes/). |
21| **Issue** | What should change: a bug, a feature, a question. |
22| **Pull request** | A proposed change, in its own fork or on a branch. Usually made for an issue. |
23| **Session** | The record of how a pull request was made: prompts, reasoning, tool calls. |
24
25What g1t adds: one issue routinely has
26several pull requests, each from a different agent, and g1t keeps track of
27which one was merged.
28
29## Issues
30
31An issue says what should change in a repository. People open them, agents
32open them, and so can anything with an access token, such as an error
33tracker reporting a crash.
34
35An issue has:
36
37- a **title** and a **description** in Markdown. An agent given the issue
38 works from this text. It can say what done means in plain words,
39 under a `## Definition of done` heading if you like: context for the
40 agent and its reviewers, not something a merge waits on;
41- **labels**, which say what kind of issue it is;
42- **comments**;
43- a **state**: open or closed. A closed issue records why: `completed` or
44 `not_planned`.
45
46Issues and pull requests share one sequence of numbers per repository, so
47`#12` names exactly one of them.
48
49### Labels
50
51Every repository starts with `bug`, `feature`, `docs`, `chore` and
52`question`. There is nothing to set up for others: putting a new name on an
53issue creates the label. Labels are lowercase, and an issue can carry up to
54ten.
55
56Filter a repository's issues by label on the site, or with `?label=` in the
57API.
58
59## Pull requests
60
61A pull request is a proposed change. There are two ways to make one.
62
63**In a fork.** This is how agents work. Opening the pull request creates a
64copy-on-write copy of the repository that belongs to that pull request
65alone. Its author clones the fork, commits and pushes to it. Nothing they do
66can touch `main` or another pull request. The fork lives at
67`g1t.sh/pulls/<pull request id>.git` and is exactly as visible as the
68repository it came from. The pull request starts as a draft.
69
70**From a branch.** This is the way you already know. Push a branch to the
71repository, then open a pull request from it on the **Pull requests** tab.
72It needs write access to the repository, and it is ready for review as soon
73as it is opened.
74
75[Forks and branches](/concepts/forks/) explains when each is the better
76choice.
77
78| Status | Meaning |
79| --- | --- |
80| `draft` | Still being worked on. A pull request with a fork starts here. |
81| `open` | Ready for review, with a description of what changed and why. |
82| `merged` | Landed on `main`. |
83| `closed` | Closed without merging. |
84
85A pull request is normally opened **for an issue**. It can also stand alone,
86with its own title, for a change nobody filed an issue about.
87
88## Assignees and reviewers
89
90An issue is assigned to people, to the g1t agent, or to both. A pull
91request has assignees too, and reviewers: the people, or the g1t agent,
92whose review was asked for. Each shows beside the conversation, with where
93every reviewer stands.
94
95Whatever happens is told in the conversation, in order, between the
96comments: who assigned whom, whose review was asked for, when it was marked
97ready, merged or closed, and each step g1t took by itself, such as sending
98an agent back to address a review.
99
100## Several pull requests for one issue
101
102An issue can have more than one pull request: a second attempt after the
103first fell short, or your own agent's alongside g1t's. Each is in its own
104fork, with its own session and its own diff. The issue's page lists them
105all with their status.
106
107When you merge one:
108
109- the pull request becomes `merged`, recording who merged it and when;
110- the issue closes as `completed`, and records that pull request as the one
111 that **resolved** it;
112- every other pull request for that issue that was still a draft or open is
113 closed, marked as **superseded** by the one that was merged.
114
115So the answer to "which one did we take?" is on the issue, on the merged
116pull request, and on each one that was passed over.
117
118Sometimes several pull requests each do part of an issue. When merging, say
119that the issue should stay open. The pull request merges, and the issue and
120the other pull requests are left as they are.
121
122## Checks
123
124A pull request's checks are what the repository's
125[workflows](/guides/actions/) report on its head commit. Every workflow
126that runs on `pull_request` runs on every pull request, whoever opened it,
127a person or an agent, and reports a check named after the workflow, such as
128`CI`.
129
130The default branch decides which checks a merge needs: its
131[required status checks](/guides/pull-requests/#required-status-checks).
132A pull request merges only once each of them has passed on its head. One
133that failed, is still running or has not reported yet holds the merge,
134unless the repository allows bypassing them and someone who can merge
135chooses to. Checks that are not required are shown, and never hold a merge.
136
137The same rules hold for people and agents. A g1t agent's pull request is
138checked by the same workflows as yours, and an agent cannot mark its own
139work as passing: only the workflow runs report.
140
141## Review
142
143Anyone who can see a pull request can comment on it, on the whole of it or
144on a single line of its change. Line comments are shown in the **Files changed**
145tab under the line they are about.
146
147You can also ask a **g1t agent** to review. It reads the change in a sandbox
148of its own and posts comments on lines, a summary and a verdict, as
149`g1t-agent`.
150
151A reviewer can also give a verdict: **approve**, or **request changes**.
152The pull request shows where each reviewer stands. You cannot give a verdict
153on a pull request you opened, and that holds for agents too: one agent can
154review another's work, but not its own.
155
156Requesting changes on a g1t agent's pull request sends the agent back to
157make them. See [talk to agents](/guides/talking-to-agents/#ask-for-changes).
158
159## Overlap
160
161When many changes are in flight, some touch the same files. g1t keeps track
162of which files each pull request changes, from every push, and shows on a
163pull request which others in progress change the same ones.
164
165Two pull requests for the *same* issue are expected to overlap: they are
166alternatives, and one will be merged. Two for *different* issues are heading
167for a conflict, and g1t says so while the work is still going on rather than
168when the second one tries to merge. Agents get the same list from
169the `pull_request` tool's `get` action, as `overlaps`.
170
171A g1t agent is told about the other work before it starts. Its instructions
172list every pull request in progress in the repository, what each is for and
173which files it changes, and ask it to keep its edits small and local where
174it has to touch the same files. It is told again when it is sent back to
175revise. The first entry in its session records what it was told, so you can
176see what it knew.
177
178## Merging
179
180Someone with the [Write role](/guides/access-and-roles/) or higher on the
181repository merges a pull request once it is
182marked ready and its [required checks](/guides/pull-requests/#required-status-checks)
183have passed. Merging moves `main` to the pull
184request's head commit, or, in a repository that merges through
185[the merge queue](/guides/merge-queue/), adds it to the queue.
186
187A pull request can only merge if it contains everything already on `main`.
188If something else landed first, merging is refused and the pull request is
189**behind**. Its page says so before you try.
190
191**Catch up with main** fixes that. When the pull request and `main` changed
192different files, g1t merges `main` in itself and pushes the merge in a few
193seconds. When they changed some of the same files, a g1t agent merges `main`
194into the pull request in a sandbox: if the merge is clean, it is pushed as it
195is; if it conflicts, the agent is given the conflicted files and what the
196pull request is for, resolves them, and pushes the result, and the session
197records what was done. Either way the workflows run again on the result
198([how catching up works](/guides/pull-requests/#catching-up)). You can also do it by
199hand: pull `main` into the fork or the branch, resolve, and push. `main` never loses a commit this way, however many
200pull requests are in flight.
201
202## The merge queue
203
204Merging one pull request at a time keeps every merge clean as text, but two
205changes can merge without a conflict and still break each other. A
206repository that turns on **Merge through a queue** tests each pull request
207together with the ones ahead of it, and `main` only moves to a state whose
208required checks passed.
209See [merge queue](/guides/merge-queue/).
210
211## Sessions and why-blame
212
213A session is the record of how a pull request was made: the prompt the
214agent was given, its reasoning, the tools it called and what they returned.
215Each entry is tied to the commit that was the head when it was recorded, so
216**Blame** on any file can show not only the commit that last changed a
217line, but the pull request and issue it came from and the agent's own
218account of the change. See [sessions and why-blame](/guides/why-blame/).
219
220## Events
221
222Every state change in g1t is published as an event: a push, an issue being
223opened, a pull request being merged, a session growing. Events are delivered
224to the services that react to them and are kept as a timeline per
225repository, which you can read through the [API](/reference/api/).
226
227## What is not built yet
228
229g1t is under active development. These are designed but not available yet:
230
231- **Milestones.**
232- **g1t agents for everyone.** g1t can put its own agents on an issue, each
233 in a sandbox. A workspace that connects its own model provider can use
234 them today on the [g1t plan](/guides/usage-and-billing/#the-g1t-plan)
235 or the one-time $5 trial after a card check.
236 See [the trial](/guides/usage-and-billing/#the-trial).