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.

580 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| **Features** | Whether it has issues. A [fork](/concepts/forks/) starts with them off. |
108| **Forking** | For a private repository, whether people who can read it may [fork it](/guides/forking-repositories/#allow-forking-a-private-repository). Public repositories can always be forked. |
109| **Danger zone** | Change visibility, archive, [transfer](/guides/transferring-repositories/), [detach a fork](/guides/forking-repositories/#detach-a-fork) and delete. Shown to people with the Admin role. |
110
111While a repository is [archived](#archive-a-repository), the settings that
112change it are turned off until it is unarchived.
113
114## Settings
115
116How a repository handles pull requests, commits, pushes and issues. Each
117setting is a field of
118[`PATCH /repos/{owner}/{name}/settings`](/reference/api/repositories/update-repo-settings/)
119(the `repository` tool's `update_settings` action), except
120`max_ref_updates`, which is
121[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)'s.
122Fields you leave out stay as they are. Changing them needs the Maintain
123[role](/guides/access-and-roles/) or higher; `max_ref_updates` needs Admin.
124
125### Pull requests
126
127| Setting | Field | Default | What it does |
128| --- | --- | --- | --- |
129| Allow merge commits | `allow_merge_commit` | On | Pull requests may merge with a merge commit (`merge`). |
130| Allow squash merging | `allow_squash_merge` | On | They may merge as one squashed commit (`squash`). |
131| Allow rebase merging | `allow_rebase_merge` | On | They may merge by making each commit again on the base (`rebase`). |
132| Allow fast-forward merging | `allow_fast_forward` | Off | They may merge by moving the base to their head, with no new commit (`fast_forward`). |
133| Default merge method | `default_merge_method` | `merge` | The method the merge button offers first, and the one a merge that names none uses. It must be allowed. |
134| Default merge commit message | `merge_commit_message` | `default` | What a merge commit says unless its merger writes it: `default`, `pull_title`, `pull_title_and_description` or `custom`. |
135| Default squash commit message | `squash_commit_message` | `default` | What a squash commit says: the same, and `pull_title_and_commits`. |
136| Merge and squash commit templates | `merge_commit_template`, `squash_commit_template` | None | The message used with `custom`, with [placeholders](/guides/pull-requests/#commit-messages). An empty string clears it. |
137| Always suggest updating branches | `suggest_updating_branches` | On | Offer to update a pull request's branch whenever its base has new commits, not only when it must be up to date. |
138| Allow auto-merge | `allow_auto_merge` | On | People may turn on [auto-merge](/guides/pull-requests/#auto-merge) for a pull request. |
139| Delete branches when they merge | `delete_branch_on_merge` | Off | A pull request's branch is deleted once it merges. It can be [restored](/guides/pull-requests/#deleting-the-branch) from the pull request. |
140
141At least one method stays allowed. [Rules](/guides/rules/#pull-requests-and-checks)
142can narrow the methods for a branch, with `allowed_merge_methods` and
143**Require linear history**; they never allow one the repository does not.
144
145### Commits
146
147| Setting | Field | Default | What it does |
148| --- | --- | --- | --- |
149| Require sign-off on web commits | `require_web_commit_sign_off` | Off | Commits made on g1t (web edits, merge and squash commits) end with a `Signed-off-by:` trailer for whoever made them, agreeing to the repository's terms, commonly the Developer Certificate of Origin. |
150| Allow comments on commits | `allow_commit_comments` | On | Anyone who can read the repository may [comment on its commits](/guides/pull-requests/#commit-comments). Off keeps existing comments readable and refuses new ones. |
151
152### Pushes
153
154| Setting | Field | Default | What it does |
155| --- | --- | --- | --- |
156| Limit how many branches and tags a push can update | `max_ref_updates` | No limit | The most branches and tags one push may create, move or delete, 1 to 1,000. A push that would change more is declined whole, so nothing of it lands: "This push changes N branches and tags; owner/name takes at most M at a time. Push fewer at once." `0` removes the limit. |
157
158### Archives
159
160| Setting | Field | Default | What it does |
161| --- | --- | --- | --- |
162| Include Git LFS objects in archives | None yet | Off | Coming soon. g1t does not store Git LFS files yet (see [limitations](/about/limitations/)), so archives hold what git stores; the setting is shown, turned off, until it does. |
163
164### Issues
165
166| Setting | Field | Default | What it does |
167| --- | --- | --- | --- |
168| Issues | `has_issues` | On; off for a [fork](/concepts/forks/) | Whether issues can be opened. Off keeps existing issues readable. `null` goes back to the default. `issues_enabled` says whether they can be opened now. |
169| Close issues when pull requests merge | `auto_close_issues` | On | A pull request that merges into the default branch closes its issue and those it names after a [closing keyword](/guides/pull-requests/#closing-issues). |
170
171```sh
172curl -X PATCH https://api.g1t.sh/repos/acme/rocket/settings \
173 -H "Authorization: Bearer $G1T_TOKEN" \
174 -H "Content-Type: application/json" \
175 -d '{"allow_merge_commit": false, "default_merge_method": "squash", "squash_commit_message": "pull_title_and_description", "delete_branch_on_merge": true}'
176```
177
178## Who can do what
179
180Each change needs a [role](/guides/access-and-roles/) on the repository.
181Owners of its workspace have Admin on it.
182
183| Change | Needs |
184| --- | --- |
185| Description, website, topics | Maintain |
186| How long artifacts are kept | Maintain |
187| [Merge, commit and issue settings](#settings) | Maintain |
188| How many branches and tags a push may update | Admin |
189| Default branch | Admin |
190| Create, delete or restore a branch | Write; the default branch is never deleted. See [branches](/guides/git/#the-branches-page) |
191| Rename a branch | Write; Admin for the default branch |
192| Rename the repository | Admin |
193| Make it public or private | Admin, and the [member privileges](/guides/workspaces/#member-privileges) to allow it, or an owner |
194| Archive or unarchive | Admin |
195| [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 |
196| Delete | An owner of its workspace, or a member with Admin when the member privileges allow it |
197| Restore and purge | An owner of its workspace |
198| See the Recently deleted list | An owner of its workspace |
199
200Renaming the repository or its default branch, changing its visibility
201and archiving it are done by a person, not a workspace token.
202
203## Edit the details
204
2051. Open the repository's **Settings → Repository**.
2062. Under **Details**, change **Description**, **Website** or **Topics**.
2073. Choose **Save**.
208
209| Field | Rules |
210| --- | --- |
211| Description | Up to 200 characters. Empty clears it. |
212| Website | An http or https address. `https://` is added when you leave the scheme out. Empty clears it. |
213| Topics | Lowercase letters, digits and hyphens, at most 20, each up to 35 characters. Separate them with commas or spaces. |
214
215From the API, call
216[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
217with the fields to change. Fields you leave out stay as they are.
218
219```sh
220curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
221 -H "Authorization: Bearer $G1T_TOKEN" \
222 -H "Content-Type: application/json" \
223 -d '{"description": "Launches things.", "website": "rocket.acme.dev", "topics": ["cli", "rust"]}'
224```
225
226Over MCP, it is the `repository` tool's `update` action, with `repo` and
227the same fields.
228
229## Change the default branch
230
231The default branch is what the repository opens on, what new clones check
232out, what pull requests target, and what branch protection covers.
233
2341. Open the repository's **Settings → Repository**.
2352. Under **Branches → Default branch**, pick another branch.
2363. Choose **Change default branch**.
237
238The branch must already exist; push it first. When you change it:
239
240- Open pull requests merge into the new default branch.
241- New clones check out the new default branch. Existing clones keep the
242 branches they have; run `git remote set-head origin -a` to update what
243 `origin/HEAD` points at.
244- [Branch protection](/guides/git/#protected-branches) covers the new
245 default branch.
246
247From the API, send `default_branch` to
248[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/):
249
250```sh
251curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
252 -H "Authorization: Bearer $G1T_TOKEN" \
253 -H "Content-Type: application/json" \
254 -d '{"default_branch": "trunk"}'
255```
256
257Over MCP, it is the `repository` tool's `update` action, with `repo` and
258`default_branch`. When the
259same call changes other fields, they are changed first.
260
261## Rename a branch
262
2631. Open the repository's **Settings → Repository**.
2642. Under **Branches → Rename a branch**, pick the **Branch** and type its
265 **New name**.
2663. Choose **Rename branch**.
267
268Or, on the repository's [Branches page](/guides/git/#the-branches-page),
269open the branch's **⋯** menu and choose **Rename branch**.
270
271Renaming the default branch needs Admin. It stays the default under its
272new name. When a branch is renamed:
273
274- Open pull requests from it follow it to the new name.
275- Web addresses that name the old branch, such as
276 `g1t.sh/acme/rocket/tree/old-name`, redirect to the new one until a
277 branch with the old name is made again.
278- Git remotes do not follow. In each clone, rename the local branch and
279 track the new one:
280
281```sh
282git branch -m old-name new-name
283git fetch origin
284git branch -u origin/new-name new-name
285git remote set-head origin -a
286```
287
288From the API, call
289[`POST /repos/{owner}/{name}/branches/{branch}/rename`](/reference/api/repositories/rename-branch/)
290with `new_name`. A branch name with slashes goes in the path URL-encoded,
291as one segment: `feature/login` is `feature%2Flogin`.
292
293```sh
294curl -X POST https://api.g1t.sh/repos/acme/rocket/branches/feature%2Flogin/rename \
295 -H "Authorization: Bearer $G1T_TOKEN" \
296 -H "Content-Type: application/json" \
297 -d '{"new_name": "feature/sign-in"}'
298```
299
300Over MCP, it is the `repository` tool's `rename_branch` action, with
301`repo`, `branch` and `new_name`.
302
303## Rename a repository
304
3051. Open the repository's **Settings → Repository**.
3062. Under **Name**, type the new name. It shows the new address.
3073. Choose **Rename**.
308
309A name is lowercase letters, digits, dots, hyphens and underscores, up to
310100 characters. It cannot start with a dot or end in `.git`, and no other
311repository in the workspace may have it, including one that was
312[recently deleted](#restore-a-repository).
313
314Everything stays with the repository: its git data, issues, pull requests,
315workflow runs, deployments, settings, secrets and webhooks. Its old address
316keeps working, the same way as after a
317[transfer](/guides/transferring-repositories/#old-addresses):
318
319| | Behaviour |
320| --- | --- |
321| Web pages | A permanent redirect (`301`) to the same page at the new address. |
322| `git clone`, `fetch`, `pull` and `push` | Redirected to the new remote. Git follows it and prints a warning each time. |
323| API and MCP | A call that names the repository by its old name runs against it under its new name. |
324
325Its project follows: a project that had the repository's name takes the
326new one, unless another project in the workspace already has it, and its
327deployed apps are built again under the new name while the old addresses
328redirect.
329
330A redirect stops as soon as a repository is made at the old address.
331Update your remotes rather than relying on it:
332
333```sh
334git remote set-url origin https://g1t.sh/acme/launcher.git
335```
336
337From the API, call
338[`POST /repos/{owner}/{name}/rename`](/reference/api/repositories/rename-repo/)
339with `name`:
340
341```sh
342curl -X POST https://api.g1t.sh/repos/acme/rocket/rename \
343 -H "Authorization: Bearer $G1T_TOKEN" \
344 -H "Content-Type: application/json" \
345 -d '{"name": "launcher"}'
346```
347
348Over MCP, it is the `repository` tool's `rename` action, with `repo` and
349`name`.
350
351## Change who can see a repository
352
353A public repository can be seen and cloned by anyone, signed in or not. A
354private one can be seen only by people with a
355[role](/guides/access-and-roles/) on it.
356
3571. Open the repository's **Settings → Repository**.
3582. Under **Danger zone → Change visibility**, choose **Make private** or
359 **Make public**.
3603. Read what changes, type the repository's full name (`<workspace>/<repo>`)
361 to confirm, and choose **Make private** or **Make public** again.
362
363A [fork](/concepts/forks/) is as visible as the repository it came from and
364cannot change on its own: [detach it](/guides/forking-repositories/#detach-a-fork)
365first. When a repository with forks is made public or private, its forks
366are detached and keep the visibility they had.
367
368| | Making it public | Making it private |
369| --- | --- | --- |
370| 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. |
371| Search and Explore | It is added to [search](/guides/search/) and Explore for everyone. | It leaves search and Explore for everyone outside the workspace. |
372| Link previews | Links to it show a preview card with its name and description. | Links to it stop showing a preview card. |
373| 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). |
374
375Nothing else changes: its address, members, settings, secrets, webhooks
376and deployments stay as they are.
377
378From the API, call
379[`POST /repos/{owner}/{name}/visibility`](/reference/api/repositories/set-repo-visibility/)
380with `private` and its full name in `confirm`:
381
382```sh
383curl -X POST https://api.g1t.sh/repos/acme/rocket/visibility \
384 -H "Authorization: Bearer $G1T_TOKEN" \
385 -H "Content-Type: application/json" \
386 -d '{"private": true, "confirm": "acme/rocket"}'
387```
388
389Over MCP, it is the `repository` tool's `set_visibility` action, with
390`repo`, `private` and `confirm`. `private` on
391[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
392makes the same change without the confirmation, for people with Admin.
393
394## Archive a repository
395
396Archiving makes a repository read-only. Use it for work that is finished
397but should stay readable.
398
3991. Open the repository's **Settings → Repository**.
4002. Under **Danger zone**, choose **Archive**.
4013. Read what changes and choose **Archive** again.
402
403While it is archived:
404
405| | |
406| --- | --- |
407| Pushes and merges | Refused, whatever your role, and for agents too. |
408| Issues and pull requests | Locked. They stay readable. |
409| Workflows | Do not run. |
410| Settings | The ones that change the repository are turned off. |
411| Deployments | Keep serving. |
412| Who can see it | Unchanged. Anyone who could see it still can, and clone it. |
413
414Its page says it is archived, and so do its project's card on the
415workspace overview and its card on [Explore](/guides/search/#explore),
416with an **archived** label. To undo it, someone with Admin chooses **Unarchive**
417in the same place. Pushes, merges, issues, pull requests and workflows
418work again; nothing that was refused while it was archived runs
419by itself.
420
421From the API, call
422[`POST /repos/{owner}/{name}/archive`](/reference/api/repositories/archive-repo/)
423or
424[`POST /repos/{owner}/{name}/unarchive`](/reference/api/repositories/unarchive-repo/):
425
426```sh
427curl -X POST https://api.g1t.sh/repos/acme/rocket/archive \
428 -H "Authorization: Bearer $G1T_TOKEN"
429```
430
431Over MCP, they are the `repository` tool's `archive` and `unarchive`
432actions, with `repo`. The
433repository's `archived_at` field says when it was archived, and is null
434when it is not.
435
436## Delete a repository
437
438Deleting takes a repository away at once, but an owner can restore it for
43930 days. After that it is purged: removed for good, its git data with it.
440
4411. Open the repository's **Settings → Repository**.
4422. Under **Danger zone**, choose **Delete**.
4433. Read what happens, type the repository's full name
444 (`<workspace>/<repo>`) to confirm, and choose **Delete repository**.
445
446| | While it is deleted | When it is purged |
447| --- | --- | --- |
448| Its pages, git remote and API | Answer as if it did not exist, for everyone. | The same. |
449| Its name | Stays taken: no repository can be made at its address. | Free to use again. |
450| Workflows | Stop, and do not start. | |
451| Deployments | Taken down. Its `g1t.page` addresses stop serving. | Removed. |
452| Custom domains | Kept, and serve nothing. | Removed. |
453| Search | Drops it. | |
454| Webhooks | The workspace's webhooks are sent `repo.deleted`. | Sent `repo.purged`. |
455| Storage | Stops counting toward the workspace's storage. | |
456| Git data, issues, pull requests, settings, secrets | Kept, for restoring. | Removed, and cannot be recovered. |
457
458Its entries in the [audit log](/guides/audit-log/) are kept, as for
459anything else.
460
461From the API, call
462[`DELETE /repos/{owner}/{name}`](/reference/api/repositories/delete-repo/)
463with its full name in `confirm`. It returns the deleted repository with
464`purge_after`, when it will be purged:
465
466```sh
467curl -X DELETE https://api.g1t.sh/repos/acme/rocket \
468 -H "Authorization: Bearer $G1T_TOKEN" \
469 -H "Content-Type: application/json" \
470 -d '{"confirm": "acme/rocket"}'
471```
472
473Over MCP, it is the `repository` tool's `delete` action, with `repo` and
474`confirm`.
475
476To move a repository to another workspace instead of deleting it, see
477[transferring a repository](/guides/transferring-repositories/).
478
479## Restore a repository
480
481A workspace's recently deleted repositories are listed for its owners
482under **Recently deleted** in the workspace's **Settings → Repositories**,
483at `g1t.sh/<workspace>/-/repositories`, each with who deleted it and when
484it will be purged.
485
4861. Open the workspace's **Settings → Repositories**.
4872. Under **Recently deleted**, find the repository and choose **Restore**.
488
489It comes back at the address it had, as it was when it was deleted: git
490data, issues, pull requests, settings, secrets and webhooks. Its
491deployments are built again, and its custom domains serve them once they
492are live. Workflows run again for new work; they do not catch up on what
493they missed.
494
495From the API, list them with
496[`GET /workspaces/{workspace}/repos/deleted`](/reference/api/repositories/list-deleted-repos/)
497(the `repository` tool's `list_deleted` action over MCP), then call
498[`POST /repos/{owner}/{name}/restore`](/reference/api/repositories/restore-repo/)
499with the path it had (the `restore` action):
500
501```sh
502curl https://api.g1t.sh/workspaces/acme/repos/deleted \
503 -H "Authorization: Bearer $G1T_TOKEN"
504
505curl -X POST https://api.g1t.sh/repos/acme/rocket/restore \
506 -H "Authorization: Bearer $G1T_TOKEN"
507```
508
509### Purge a repository now
510
511To remove a deleted repository for good before its 30 days are up, and
512free its name:
513
5141. Open the workspace's **Settings → Repositories**.
5152. Under **Recently deleted**, choose **Delete permanently** beside it.
5163. Type its full name (`<workspace>/<repo>`) to confirm, and choose
517 **Delete permanently** again.
518
519This cannot be undone. From the API, call
520[`POST /repos/{owner}/{name}/purge`](/reference/api/repositories/purge-repo/)
521with its full name in `confirm`:
522
523```sh
524curl -X POST https://api.g1t.sh/repos/acme/rocket/purge \
525 -H "Authorization: Bearer $G1T_TOKEN" \
526 -H "Content-Type: application/json" \
527 -d '{"confirm": "acme/rocket"}'
528```
529
530Over MCP, it is the `repository` tool's `purge` action, with `repo` and
531`confirm`.
532
533A workspace whose only repositories are recently deleted ones can itself
534be [deleted](/guides/workspaces/#delete-a-workspace); they are purged with
535it.
536
537## When a change is refused
538
539| Response | Why | What to do |
540| --- | --- | --- |
541| `401 unauthenticated` | No token, or one that is not valid. | Send a personal access token. |
542| `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. |
543| `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. |
544| `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. |
545| `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. |
546| `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. |
547
548Each refusal comes with a message that says what to do.
549
550## From the API and MCP
551
552| Route | MCP | What it does |
553| --- | --- | --- |
554| [`GET /repos/{owner}/{name}/languages`](/reference/api/repository-insights/get-languages/) | `repository` `languages` | Its languages by bytes, with `color` and `percent`. |
555| [`GET /repos/{owner}/{name}/contributors`](/reference/api/repository-insights/list-contributors/) | `repository` `contributors` | Its contributors with `kind`, `commits` and `weeks`. |
556| [`GET /repos/{owner}/{name}/license`](/reference/api/repository-insights/get-license/) | `repository` `license` | Its license's `spdx_id`, `name` and `path`. |
557| [`GET /repos/{owner}/{name}/stargazers`](/reference/api/stars/list-stargazers/) | `repository` `stargazers` | Who starred it, newest first. |
558| [`PUT /user/starred/{owner}/{name}`](/reference/api/stars/star-repo/) | `repository` `star` | Star it. `DELETE` takes the star back; `GET` says whether you did. |
559| [`GET /user/starred`](/reference/api/stars/list-starred/) | `repository` `list_starred` | What you starred. |
560
561Answers read from the default branch say which `commit` they are for and
562the `head` now; `pending` is true until the first is read. Stars take the
563`account:read` and `account:write` scopes; the rest `repo:read`.
564
565## Events and the audit log
566
567Each change is sent to [webhooks](/guides/webhooks/#events) and recorded
568in the [audit log](/guides/audit-log/):
569
570| Change | Event |
571| --- | --- |
572| Description, website, topics, protection | `repo.updated` |
573| Visibility | `repo.visibility_changed` |
574| Rename | `repo.renamed` |
575| Default branch | `repo.default_branch_changed` |
576| Branch rename | `branch.renamed` |
577| Branch made or deleted | `git.push`, `git.deleted`; in the audit log, `branch.created`, `branch.deleted` |
578| Archive, unarchive | `repo.archived`, `repo.unarchived` |
579| Transfer | `repo.transferred` |
580| Delete, restore, purge | `repo.deleted`, `repo.restored`, `repo.purged` |