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.

g1t.sh
507 linesCodeBlameRaw
1---
2title: Managing a repository
3description: What a repository's header and Code page show, and how to rename it or a branch, change its default branch, website and topics, make it public or private, archive it, and delete and restore it.
4---
5
6A repository's details and its lifecycle are managed from its
7**Settings → Repository** page, at
8`g1t.sh/<workspace>/<repo>/settings/repository`, and from the API and MCP
9server. This guide covers each change, who can make it, and what happens
10when you do.
11
12## What it is, and the facts beside the files
13
14The header at the top of every page of a repository (Code, Issues, Pull
15requests, Actions, Settings and the rest) shows its description, website
16and topics, as you set them under [Edit the details](#edit-the-details).
17The website is the project's homepage when it has one.
18
19The **Code** page shows its files with its facts beside them. On a phone
20they come after the files.
21
22| Part | What it shows |
23| --- | --- |
24| **Readme** | A link to the README shown under the files. |
25| **License** | The license its `LICENSE` file holds, such as **MIT license**, linked to the file. **View license** when the text is not one g1t recognizes. `LICENCE`, `COPYING` and `UNLICENSE` are read too, with or without an extension, and an `SPDX-License-Identifier` line says it outright. |
26| **Security policy** | A link to `SECURITY.md` at the root, or in `.g1t`, `.github` or `docs`. |
27| **Activity** | The repository's [activity](#activity): pushes, merges, new branches and tags. |
28| **Stars**, **watching** | How many people [starred](#stars) it, and how many watch all or some of its activity from the [Watch menu](/guides/notifications/). |
29| **Releases** | How many [releases](/guides/releases/) it has and the latest. With none published, how many tags it has, linked to its tags, and **Create a new release** for people who can push. |
30| **Packages** | [Packages](/guides/packages/) linked to it, or how to publish the first. |
31| **Contributors** | How many people and agents made it. Up to five are listed by name with how many commits each made; more show as the most active's avatars. Each opens their card. See [contributors](#contributors). |
32| **Languages** | The languages it is written in, by bytes. See [languages](#languages). |
33
34The license, security policy, languages and contributors are read from the
35default branch in the background each time it moves, and kept by commit, so
36the page never waits for them. A repository pushed to for the first time
37shows **Reading the default branch…** for a few seconds.
38
39### Languages
40
41The bar counts the bytes of each language's files on the default branch.
42Programming and markup languages count; data such as JSON and YAML, and
43prose such as Markdown, do not. TSX counts as TypeScript and JSX as
44JavaScript. The sidebar lists every language down to a tenth of a percent,
45the largest eight, and gathers the rest as **Other**. Neither do these count:
46
47| Files | Such as |
48| --- | --- |
49| Vendored | `node_modules/`, `vendor/`, `third_party/`, minified jQuery, and anything under a dot-directory such as `.github/` |
50| Generated | `dist/`, `*.min.js`, `*.pb.go`, lockfiles |
51| Documentation | `docs/`, `doc/`, `examples/` |
52
53Change what counts with `linguist-*` attributes in the repository's
54`.gitattributes` file at the root. A later line wins over an earlier one.
55
56```text
57vendor/ours/** -linguist-vendored
58*.gen.ts linguist-generated
59docs/** -linguist-documentation
60*.inc linguist-language=PHP
61*.sql linguist-detectable
62```
63
64A repository too large to read in full (more than 10,000 files) counts the
65files read.
66
67### Contributors
68
69**Insights → Contributors** lists everyone whose commits are on the default
70branch, most commits first, with their commits by week, and the
71repository's commits per week over the last year.
72
73| Who | How they are matched |
74| --- | --- |
75| A person | By an address they confirmed on their account, or their noreply address. Several addresses of one account count as one. |
76| g1t | Its own commits, by its address. |
77| A coding agent or bot | Claude, Codex, Copilot, Gemini, Jules, Cursor, Devin, Aider, Dependabot, Renovate and GitHub Actions, by the address they write on their commits (as author or `Co-authored-by`), never by name. Each shows its maker's mark and a card saying what it is; none is an account on g1t. |
78| Anyone else | By the name on their commits, with a card that says they aren't on g1t and how to add the address to your account if the commits are yours. |
79
80The newest 3,000 commits are counted.
81
82### Activity
83
84**Insights → Activity** lists, newest first, who pushed to which branch,
85created a branch or tag, deleted a branch (with the commit it pointed to),
86merged a pull request, renamed a branch or changed the default branch,
87person or agent. A branch's **Activity**, from its **⋯** menu on the
88[Branches page](/guides/git/#the-branches-page), keeps only what happened to
89that branch (`?branch=<name>`); each page of the repository's activity is
90read and filtered, so **Older** may be needed to reach earlier changes.
91
92### Stars
93
94Choose **Star** in the repository's header to keep it in your profile's
95**Stars** tab, at `g1t.sh/u/<you>?tab=stars`. The number beside it leads
96to who starred it. Anyone signed in who can read a repository can star it;
97stars on a private repository are seen only by people who can read it.
98
99## The settings page
100
101| Section | What it holds |
102| --- | --- |
103| **Name** | The repository's name, the second part of its address. |
104| **Details** | Its description, website and topics, shown on its page, in [search and Explore](/guides/search/). |
105| **Branches** | The default branch, renaming a branch, and a link to **Branches and merging**: [branch protection](/guides/git/#protected-branches), [required status checks](/guides/pull-requests/#required-status-checks), required approvals, and the [merge queue](/guides/merge-queue/). What a sandbox may reach is under **Guardrails**; see [guardrails](/guides/guardrails/). |
106| **Artifacts** | How many days the files workflow runs upload are kept, 1 to 90 (14 unless changed). See [artifacts](/guides/actions/#artifacts). |
107| **Danger zone** | Change visibility, archive, [transfer](/guides/transferring-repositories/) and delete. Shown to people with the Admin role. |
108
109While a repository is [archived](#archive-a-repository), the settings that
110change it are turned off until it is unarchived.
111
112## Who can do what
113
114Each change needs a [role](/guides/access-and-roles/) on the repository.
115Owners of its workspace have Admin on it.
116
117| Change | Needs |
118| --- | --- |
119| Description, website, topics | Maintain |
120| How long artifacts are kept | Maintain |
121| Default branch | Admin |
122| Create, delete or restore a branch | Write; the default branch is never deleted. See [branches](/guides/git/#the-branches-page) |
123| Rename a branch | Write; Admin for the default branch |
124| Rename the repository | Admin |
125| Make it public or private | Admin, and the [member privileges](/guides/workspaces/#member-privileges) to allow it, or an owner |
126| Archive or unarchive | Admin |
127| [Transfer](/guides/transferring-repositories/) | An owner of its workspace, or a member with Admin when the member privileges allow it; and in the other workspace, being able to create a repository |
128| Delete | An owner of its workspace, or a member with Admin when the member privileges allow it |
129| Restore and purge | An owner of its workspace |
130| See the Recently deleted list | An owner of its workspace |
131
132Renaming the repository or its default branch, changing its visibility
133and archiving it are done by a person, not a workspace token.
134
135## Edit the details
136
1371. Open the repository's **Settings → Repository**.
1382. Under **Details**, change **Description**, **Website** or **Topics**.
1393. Choose **Save**.
140
141| Field | Rules |
142| --- | --- |
143| Description | Up to 200 characters. Empty clears it. |
144| Website | An http or https address. `https://` is added when you leave the scheme out. Empty clears it. |
145| Topics | Lowercase letters, digits and hyphens, at most 20, each up to 35 characters. Separate them with commas or spaces. |
146
147From the API, call
148[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
149with the fields to change. Fields you leave out stay as they are.
150
151```sh
152curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
153 -H "Authorization: Bearer $G1T_TOKEN" \
154 -H "Content-Type: application/json" \
155 -d '{"description": "Launches things.", "website": "rocket.acme.dev", "topics": ["cli", "rust"]}'
156```
157
158Over MCP, it is the `repository` tool's `update` action, with `repo` and
159the same fields.
160
161## Change the default branch
162
163The default branch is what the repository opens on, what new clones check
164out, what pull requests target, and what branch protection covers.
165
1661. Open the repository's **Settings → Repository**.
1672. Under **Branches → Default branch**, pick another branch.
1683. Choose **Change default branch**.
169
170The branch must already exist; push it first. When you change it:
171
172- Open pull requests merge into the new default branch.
173- New clones check out the new default branch. Existing clones keep the
174 branches they have; run `git remote set-head origin -a` to update what
175 `origin/HEAD` points at.
176- [Branch protection](/guides/git/#protected-branches) covers the new
177 default branch.
178
179From the API, send `default_branch` to
180[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/):
181
182```sh
183curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
184 -H "Authorization: Bearer $G1T_TOKEN" \
185 -H "Content-Type: application/json" \
186 -d '{"default_branch": "trunk"}'
187```
188
189Over MCP, it is the `repository` tool's `update` action, with `repo` and
190`default_branch`. When the
191same call changes other fields, they are changed first.
192
193## Rename a branch
194
1951. Open the repository's **Settings → Repository**.
1962. Under **Branches → Rename a branch**, pick the **Branch** and type its
197 **New name**.
1983. Choose **Rename branch**.
199
200Or, on the repository's [Branches page](/guides/git/#the-branches-page),
201open the branch's **⋯** menu and choose **Rename branch**.
202
203Renaming the default branch needs Admin. It stays the default under its
204new name. When a branch is renamed:
205
206- Open pull requests from it follow it to the new name.
207- Web addresses that name the old branch, such as
208 `g1t.sh/acme/rocket/tree/old-name`, redirect to the new one until a
209 branch with the old name is made again.
210- Git remotes do not follow. In each clone, rename the local branch and
211 track the new one:
212
213```sh
214git branch -m old-name new-name
215git fetch origin
216git branch -u origin/new-name new-name
217git remote set-head origin -a
218```
219
220From the API, call
221[`POST /repos/{owner}/{name}/branches/{branch}/rename`](/reference/api/repositories/rename-branch/)
222with `new_name`. A branch name with slashes goes in the path URL-encoded,
223as one segment: `feature/login` is `feature%2Flogin`.
224
225```sh
226curl -X POST https://api.g1t.sh/repos/acme/rocket/branches/feature%2Flogin/rename \
227 -H "Authorization: Bearer $G1T_TOKEN" \
228 -H "Content-Type: application/json" \
229 -d '{"new_name": "feature/sign-in"}'
230```
231
232Over MCP, it is the `repository` tool's `rename_branch` action, with
233`repo`, `branch` and `new_name`.
234
235## Rename a repository
236
2371. Open the repository's **Settings → Repository**.
2382. Under **Name**, type the new name. It shows the new address.
2393. Choose **Rename**.
240
241A name is lowercase letters, digits, dots, hyphens and underscores, up to
242100 characters. It cannot start with a dot or end in `.git`, and no other
243repository in the workspace may have it, including one that was
244[recently deleted](#restore-a-repository).
245
246Everything stays with the repository: its git data, issues, pull requests,
247workflow runs, deployments, settings, secrets and webhooks. Its old address
248keeps working, the same way as after a
249[transfer](/guides/transferring-repositories/#old-addresses):
250
251| | Behaviour |
252| --- | --- |
253| Web pages | A permanent redirect (`301`) to the same page at the new address. |
254| `git clone`, `fetch`, `pull` and `push` | Redirected to the new remote. Git follows it and prints a warning each time. |
255| API and MCP | A call that names the repository by its old name runs against it under its new name. |
256
257Its project follows: a project that had the repository's name takes the
258new one, unless another project in the workspace already has it, and its
259deployed apps are built again under the new name while the old addresses
260redirect.
261
262A redirect stops as soon as a repository is made at the old address.
263Update your remotes rather than relying on it:
264
265```sh
266git remote set-url origin https://g1t.sh/acme/launcher.git
267```
268
269From the API, call
270[`POST /repos/{owner}/{name}/rename`](/reference/api/repositories/rename-repo/)
271with `name`:
272
273```sh
274curl -X POST https://api.g1t.sh/repos/acme/rocket/rename \
275 -H "Authorization: Bearer $G1T_TOKEN" \
276 -H "Content-Type: application/json" \
277 -d '{"name": "launcher"}'
278```
279
280Over MCP, it is the `repository` tool's `rename` action, with `repo` and
281`name`.
282
283## Change who can see a repository
284
285A public repository can be seen and cloned by anyone, signed in or not. A
286private one can be seen only by people with a
287[role](/guides/access-and-roles/) on it.
288
2891. Open the repository's **Settings → Repository**.
2902. Under **Danger zone → Change visibility**, choose **Make private** or
291 **Make public**.
2923. Read what changes, type the repository's full name (`<workspace>/<repo>`)
293 to confirm, and choose **Make private** or **Make public** again.
294
295| | Making it public | Making it private |
296| --- | --- | --- |
297| Who can see it | Anyone: its code, issues and pull requests, and cloning it, without signing in. | Only people with a role on it: its workspace's owners, its members (unless the [base permission](/guides/access-and-roles/#the-base-permission) is None), and anyone given a role on it. Anyone else gets a page that says it does not exist. |
298| Search and Explore | It is added to [search](/guides/search/) and Explore for everyone. | It leaves search and Explore for everyone outside the workspace. |
299| Link previews | Links to it show a preview card with its name and description. | Links to it stop showing a preview card. |
300| Storage | It stops counting toward the workspace's private storage. | It counts toward the workspace's private storage. A free workspace has 1 GB; making it private is refused when that would go over. See [what is free](/guides/usage-and-billing/#what-is-free). |
301
302Nothing else changes: its address, members, settings, secrets, webhooks
303and deployments stay as they are.
304
305From the API, call
306[`POST /repos/{owner}/{name}/visibility`](/reference/api/repositories/set-repo-visibility/)
307with `private` and its full name in `confirm`:
308
309```sh
310curl -X POST https://api.g1t.sh/repos/acme/rocket/visibility \
311 -H "Authorization: Bearer $G1T_TOKEN" \
312 -H "Content-Type: application/json" \
313 -d '{"private": true, "confirm": "acme/rocket"}'
314```
315
316Over MCP, it is the `repository` tool's `set_visibility` action, with
317`repo`, `private` and `confirm`. `private` on
318[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
319makes the same change without the confirmation, for people with Admin.
320
321## Archive a repository
322
323Archiving makes a repository read-only. Use it for work that is finished
324but should stay readable.
325
3261. Open the repository's **Settings → Repository**.
3272. Under **Danger zone**, choose **Archive**.
3283. Read what changes and choose **Archive** again.
329
330While it is archived:
331
332| | |
333| --- | --- |
334| Pushes and merges | Refused, whatever your role, and for agents too. |
335| Issues and pull requests | Locked. They stay readable. |
336| Workflows | Do not run. |
337| Settings | The ones that change the repository are turned off. |
338| Deployments | Keep serving. |
339| Who can see it | Unchanged. Anyone who could see it still can, and clone it. |
340
341Its page says it is archived, and so do its project's card on the
342workspace overview and its card on [Explore](/guides/search/#explore),
343with an **archived** label. To undo it, someone with Admin chooses **Unarchive**
344in the same place. Pushes, merges, issues, pull requests and workflows
345work again; nothing that was refused while it was archived runs
346by itself.
347
348From the API, call
349[`POST /repos/{owner}/{name}/archive`](/reference/api/repositories/archive-repo/)
350or
351[`POST /repos/{owner}/{name}/unarchive`](/reference/api/repositories/unarchive-repo/):
352
353```sh
354curl -X POST https://api.g1t.sh/repos/acme/rocket/archive \
355 -H "Authorization: Bearer $G1T_TOKEN"
356```
357
358Over MCP, they are the `repository` tool's `archive` and `unarchive`
359actions, with `repo`. The
360repository's `archived_at` field says when it was archived, and is null
361when it is not.
362
363## Delete a repository
364
365Deleting takes a repository away at once, but an owner can restore it for
36630 days. After that it is purged: removed for good, its git data with it.
367
3681. Open the repository's **Settings → Repository**.
3692. Under **Danger zone**, choose **Delete**.
3703. Read what happens, type the repository's full name
371 (`<workspace>/<repo>`) to confirm, and choose **Delete repository**.
372
373| | While it is deleted | When it is purged |
374| --- | --- | --- |
375| Its pages, git remote and API | Answer as if it did not exist, for everyone. | The same. |
376| Its name | Stays taken: no repository can be made at its address. | Free to use again. |
377| Workflows | Stop, and do not start. | |
378| Deployments | Taken down. Its `g1t.page` addresses stop serving. | Removed. |
379| Custom domains | Kept, and serve nothing. | Removed. |
380| Search | Drops it. | |
381| Webhooks | The workspace's webhooks are sent `repo.deleted`. | Sent `repo.purged`. |
382| Storage | Stops counting toward the workspace's storage. | |
383| Git data, issues, pull requests, settings, secrets | Kept, for restoring. | Removed, and cannot be recovered. |
384
385Its entries in the [audit log](/guides/audit-log/) are kept, as for
386anything else.
387
388From the API, call
389[`DELETE /repos/{owner}/{name}`](/reference/api/repositories/delete-repo/)
390with its full name in `confirm`. It returns the deleted repository with
391`purge_after`, when it will be purged:
392
393```sh
394curl -X DELETE https://api.g1t.sh/repos/acme/rocket \
395 -H "Authorization: Bearer $G1T_TOKEN" \
396 -H "Content-Type: application/json" \
397 -d '{"confirm": "acme/rocket"}'
398```
399
400Over MCP, it is the `repository` tool's `delete` action, with `repo` and
401`confirm`.
402
403To move a repository to another workspace instead of deleting it, see
404[transferring a repository](/guides/transferring-repositories/).
405
406## Restore a repository
407
408A workspace's recently deleted repositories are listed for its owners
409under **Recently deleted** in the workspace's **Settings → Repositories**,
410at `g1t.sh/<workspace>/-/repositories`, each with who deleted it and when
411it will be purged.
412
4131. Open the workspace's **Settings → Repositories**.
4142. Under **Recently deleted**, find the repository and choose **Restore**.
415
416It comes back at the address it had, as it was when it was deleted: git
417data, issues, pull requests, settings, secrets and webhooks. Its
418deployments are built again, and its custom domains serve them once they
419are live. Workflows run again for new work; they do not catch up on what
420they missed.
421
422From the API, list them with
423[`GET /workspaces/{workspace}/repos/deleted`](/reference/api/repositories/list-deleted-repos/)
424(the `repository` tool's `list_deleted` action over MCP), then call
425[`POST /repos/{owner}/{name}/restore`](/reference/api/repositories/restore-repo/)
426with the path it had (the `restore` action):
427
428```sh
429curl https://api.g1t.sh/workspaces/acme/repos/deleted \
430 -H "Authorization: Bearer $G1T_TOKEN"
431
432curl -X POST https://api.g1t.sh/repos/acme/rocket/restore \
433 -H "Authorization: Bearer $G1T_TOKEN"
434```
435
436### Purge a repository now
437
438To remove a deleted repository for good before its 30 days are up, and
439free its name:
440
4411. Open the workspace's **Settings → Repositories**.
4422. Under **Recently deleted**, choose **Delete permanently** beside it.
4433. Type its full name (`<workspace>/<repo>`) to confirm, and choose
444 **Delete permanently** again.
445
446This cannot be undone. From the API, call
447[`POST /repos/{owner}/{name}/purge`](/reference/api/repositories/purge-repo/)
448with its full name in `confirm`:
449
450```sh
451curl -X POST https://api.g1t.sh/repos/acme/rocket/purge \
452 -H "Authorization: Bearer $G1T_TOKEN" \
453 -H "Content-Type: application/json" \
454 -d '{"confirm": "acme/rocket"}'
455```
456
457Over MCP, it is the `repository` tool's `purge` action, with `repo` and
458`confirm`.
459
460A workspace whose only repositories are recently deleted ones can itself
461be [deleted](/guides/workspaces/#delete-a-workspace); they are purged with
462it.
463
464## When a change is refused
465
466| Response | Why | What to do |
467| --- | --- | --- |
468| `401 unauthenticated` | No token, or one that is not valid. | Send a personal access token. |
469| `403 forbidden` | You are not an owner, for a change that needs one; or g1t's token was used. | Ask an owner of the workspace. |
470| `404 not_found` | No such repository or branch, or you cannot see it. For restore and purge: no deleted repository had that path, or it was purged. | Check the path. A deleted repository is named by the path it had. |
471| `409 conflict` | The new name is taken in the workspace, by a repository or a recently deleted one; or a branch with the new name exists. | Pick another name, or purge the deleted repository first. |
472| `422 invalid` | `confirm` is not the repository's full name; the name, branch name or website is not valid; or the new default branch does not exist. | Type `<workspace>/<repo>` exactly; push the branch first. |
473| `402 payment_required` | Making it private would take a free workspace's private storage over 1 GB. | Start [the g1t plan](/guides/usage-and-billing/#the-g1t-plan), or make room first. |
474
475Each refusal comes with a message that says what to do.
476
477## From the API and MCP
478
479| Route | MCP | What it does |
480| --- | --- | --- |
481| [`GET /repos/{owner}/{name}/languages`](/reference/api/repository-insights/get-languages/) | `repository` `languages` | Its languages by bytes, with `color` and `percent`. |
482| [`GET /repos/{owner}/{name}/contributors`](/reference/api/repository-insights/list-contributors/) | `repository` `contributors` | Its contributors with `kind`, `commits` and `weeks`. |
483| [`GET /repos/{owner}/{name}/license`](/reference/api/repository-insights/get-license/) | `repository` `license` | Its license's `spdx_id`, `name` and `path`. |
484| [`GET /repos/{owner}/{name}/stargazers`](/reference/api/stars/list-stargazers/) | `repository` `stargazers` | Who starred it, newest first. |
485| [`PUT /user/starred/{owner}/{name}`](/reference/api/stars/star-repo/) | `repository` `star` | Star it. `DELETE` takes the star back; `GET` says whether you did. |
486| [`GET /user/starred`](/reference/api/stars/list-starred/) | `repository` `list_starred` | What you starred. |
487
488Answers read from the default branch say which `commit` they are for and
489the `head` now; `pending` is true until the first is read. Stars take the
490`account:read` and `account:write` scopes; the rest `repo:read`.
491
492## Events and the audit log
493
494Each change is sent to [webhooks](/guides/webhooks/#events) and recorded
495in the [audit log](/guides/audit-log/):
496
497| Change | Event |
498| --- | --- |
499| Description, website, topics, protection | `repo.updated` |
500| Visibility | `repo.visibility_changed` |
501| Rename | `repo.renamed` |
502| Default branch | `repo.default_branch_changed` |
503| Branch rename | `branch.renamed` |
504| Branch made or deleted | `git.push`, `git.deleted`; in the audit log, `branch.created`, `branch.deleted` |
505| Archive, unarchive | `repo.archived`, `repo.unarchived` |
506| Transfer | `repo.transferred` |
507| Delete, restore, purge | `repo.deleted`, `repo.restored`, `repo.purged` |