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.

592 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 project's description,
16and its website and topics as you set them under
17[Edit the details](#edit-the-details). The website is the project's
18homepage when it has one.
19
20A repository has no description of its own: its
21[project](/guides/projects/) has, and search, link previews and lists of
22repositories show that one. Change it in the project's **Settings →
23General**, or with
24[`update_project`](/reference/api/projects/update-project/) (or
25`description` on [`update_repo`](/reference/api/repositories/update-repo/),
26which changes the same one).
27
28The **Code** page shows its files with its facts beside them. On a phone
29they come after the files.
30
31| Part | What it shows |
32| --- | --- |
33| **Readme** | A link to the README shown under the files. |
34| **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. |
35| **Security policy** | A link to `SECURITY.md` at the root, or in `.g1t`, `.github` or `docs`. |
36| **Activity** | The repository's [activity](#activity): pushes, merges, new branches and tags. |
37| **Stars**, **watching** | How many people [starred](#stars) it, and how many watch all or some of its activity from the [Watch menu](/guides/notifications/). |
38| **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. |
39| **Packages** | [Packages](/guides/packages/) linked to it, or how to publish the first. |
40| **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). |
41| **Languages** | The languages it is written in, by bytes. See [languages](#languages). |
42
43The license, security policy, languages and contributors are read from the
44default branch in the background each time it moves, and kept by commit, so
45the page never waits for them. A push to the default branch starts the
46reading as soon as git has its answer; a branch that moved otherwise, such
47as by merging a pull request, is read again when its page is next opened.
48A repository pushed to for the first time shows **Reading the default
49branch…** for a few seconds.
50
51### Languages
52
53The bar counts the bytes of each language's files on the default branch.
54Programming and markup languages count; data such as JSON and YAML, and
55prose such as Markdown, do not. TSX counts as TypeScript and JSX as
56JavaScript. The sidebar lists every language down to a tenth of a percent,
57the largest eight, and gathers the rest as **Other**. Neither do these count:
58
59| Files | Such as |
60| --- | --- |
61| Vendored | `node_modules/`, `vendor/`, `third_party/`, minified jQuery, and anything under a dot-directory such as `.github/` |
62| Generated | `dist/`, `*.min.js`, `*.pb.go`, lockfiles |
63| Documentation | `docs/`, `doc/`, `examples/` |
64
65Change what counts with `linguist-*` attributes in the repository's
66`.gitattributes` file at the root. A later line wins over an earlier one.
67
68```text
69vendor/ours/** -linguist-vendored
70*.gen.ts linguist-generated
71docs/** -linguist-documentation
72*.inc linguist-language=PHP
73*.sql linguist-detectable
74```
75
76A repository too large to read in full (more than 10,000 files) counts the
77files read.
78
79### Contributors
80
81**Insights → Contributors** lists everyone whose commits are on the default
82branch, most commits first, with their commits by week, and the
83repository's commits per week over the last year.
84
85| Who | How they are matched |
86| --- | --- |
87| A person | By an address they confirmed on their account, or their noreply address. Several addresses of one account count as one. |
88| g1t | Its own commits, by its address. |
89| 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. |
90| 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. |
91
92The newest 3,000 commits are counted.
93
94### Activity
95
96**Insights → Activity** lists, newest first, who pushed to which branch,
97created a branch or tag, deleted a branch (with the commit it pointed to),
98merged a pull request, renamed a branch or changed the default branch,
99person or agent. A branch's **Activity**, from its **⋯** menu on the
100[Branches page](/guides/git/#the-branches-page), keeps only what happened to
101that branch (`?branch=<name>`); each page of the repository's activity is
102read and filtered, so **Older** may be needed to reach earlier changes.
103
104### Stars
105
106Choose **Star** in the repository's header to keep it in your profile's
107**Stars** tab, at `g1t.sh/u/<you>?tab=stars`. The number beside it leads
108to who starred it. Anyone signed in who can read a repository can star it;
109stars on a private repository are seen only by people who can read it.
110
111## The settings page
112
113| Section | What it holds |
114| --- | --- |
115| **Name** | The repository's name, the second part of its address. |
116| **Details** | Its website and topics, shown on its page, in [search and Explore](/guides/search/). Its description is its project's, on **General**. |
117| **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/). |
118| **Artifacts** | How many days the files workflow runs upload are kept, 1 to 90 (14 unless changed). See [artifacts](/guides/actions/#artifacts). |
119| **Features** | Whether it has issues. A [fork](/concepts/forks/) starts with them off. |
120| **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. |
121| **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. |
122
123While a repository is [archived](#archive-a-repository), the settings that
124change it are turned off until it is unarchived.
125
126## Settings
127
128How a repository handles pull requests, commits, pushes and issues. Each
129setting is a field of
130[`PATCH /repos/{owner}/{name}/settings`](/reference/api/repositories/update-repo-settings/)
131(the `repository` tool's `update_settings` action), except
132`max_ref_updates`, which is
133[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)'s.
134Fields you leave out stay as they are. Changing them needs the Maintain
135[role](/guides/access-and-roles/) or higher; `max_ref_updates` needs Admin.
136
137### Pull requests
138
139| Setting | Field | Default | What it does |
140| --- | --- | --- | --- |
141| Allow merge commits | `allow_merge_commit` | On | Pull requests may merge with a merge commit (`merge`). |
142| Allow squash merging | `allow_squash_merge` | On | They may merge as one squashed commit (`squash`). |
143| Allow rebase merging | `allow_rebase_merge` | On | They may merge by making each commit again on the base (`rebase`). |
144| Allow fast-forward merging | `allow_fast_forward` | Off | They may merge by moving the base to their head, with no new commit (`fast_forward`). |
145| 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. |
146| 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`. |
147| Default squash commit message | `squash_commit_message` | `default` | What a squash commit says: the same, and `pull_title_and_commits`. |
148| 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. |
149| 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. |
150| Allow auto-merge | `allow_auto_merge` | On | People may turn on [auto-merge](/guides/pull-requests/#auto-merge) for a pull request. |
151| 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. |
152
153At least one method stays allowed. [Rules](/guides/rules/#pull-requests-and-checks)
154can narrow the methods for a branch, with `allowed_merge_methods` and
155**Require linear history**; they never allow one the repository does not.
156
157### Commits
158
159| Setting | Field | Default | What it does |
160| --- | --- | --- | --- |
161| 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. |
162| 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. |
163
164### Pushes
165
166| Setting | Field | Default | What it does |
167| --- | --- | --- | --- |
168| 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. |
169
170### Archives
171
172| Setting | Field | Default | What it does |
173| --- | --- | --- | --- |
174| 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. |
175
176### Issues
177
178| Setting | Field | Default | What it does |
179| --- | --- | --- | --- |
180| 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. |
181| 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), and so does a commit pushed to the default branch whose message names them. |
182
183```sh
184curl -X PATCH https://api.g1t.sh/repos/acme/rocket/settings \
185 -H "Authorization: Bearer $G1T_TOKEN" \
186 -H "Content-Type: application/json" \
187 -d '{"allow_merge_commit": false, "default_merge_method": "squash", "squash_commit_message": "pull_title_and_description", "delete_branch_on_merge": true}'
188```
189
190## Who can do what
191
192Each change needs a [role](/guides/access-and-roles/) on the repository.
193Owners of its workspace have Admin on it.
194
195| Change | Needs |
196| --- | --- |
197| Website, topics | Maintain |
198| How long artifacts are kept | Maintain |
199| [Merge, commit and issue settings](#settings) | Maintain |
200| How many branches and tags a push may update | Admin |
201| Default branch | Admin |
202| Create, delete or restore a branch | Write; the default branch is never deleted. See [branches](/guides/git/#the-branches-page) |
203| Rename a branch | Write; Admin for the default branch |
204| Rename the repository | Admin |
205| Make it public or private | Admin, and the [member privileges](/guides/workspaces/#member-privileges) to allow it, or an owner |
206| Archive or unarchive | Admin |
207| [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 |
208| Delete | An owner of its workspace, or a member with Admin when the member privileges allow it |
209| Restore and purge | An owner of its workspace |
210| See the Recently deleted list | An owner of its workspace |
211
212Renaming the repository or its default branch, changing its visibility
213and archiving it are done by a person, not a workspace token.
214
215## Edit the details
216
2171. Open the repository's **Settings → Repository**.
2182. Under **Details**, change **Website** or **Topics**. The description
219 is the project's: change it on **Settings → General**.
2203. Choose **Save**.
221
222| Field | Rules |
223| --- | --- |
224| Website | An http or https address. `https://` is added when you leave the scheme out. Empty clears it. |
225| Topics | Lowercase letters, digits and hyphens, at most 20, each up to 35 characters. Separate them with commas or spaces. |
226
227From the API, call
228[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
229with the fields to change. Fields you leave out stay as they are.
230
231```sh
232curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
233 -H "Authorization: Bearer $G1T_TOKEN" \
234 -H "Content-Type: application/json" \
235 -d '{"website": "rocket.acme.dev", "topics": ["cli", "rust"]}'
236```
237
238Over MCP, it is the `repository` tool's `update` action, with `repo` and
239the same fields.
240
241## Change the default branch
242
243The default branch is what the repository opens on, what new clones check
244out, what pull requests target, and what branch protection covers.
245
2461. Open the repository's **Settings → Repository**.
2472. Under **Branches → Default branch**, pick another branch.
2483. Choose **Change default branch**.
249
250The branch must already exist; push it first. When you change it:
251
252- Open pull requests merge into the new default branch.
253- New clones check out the new default branch. Existing clones keep the
254 branches they have; run `git remote set-head origin -a` to update what
255 `origin/HEAD` points at.
256- [Branch protection](/guides/git/#protected-branches) covers the new
257 default branch.
258
259From the API, send `default_branch` to
260[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/):
261
262```sh
263curl -X PATCH https://api.g1t.sh/repos/acme/rocket \
264 -H "Authorization: Bearer $G1T_TOKEN" \
265 -H "Content-Type: application/json" \
266 -d '{"default_branch": "trunk"}'
267```
268
269Over MCP, it is the `repository` tool's `update` action, with `repo` and
270`default_branch`. When the
271same call changes other fields, they are changed first.
272
273## Rename a branch
274
2751. Open the repository's **Settings → Repository**.
2762. Under **Branches → Rename a branch**, pick the **Branch** and type its
277 **New name**.
2783. Choose **Rename branch**.
279
280Or, on the repository's [Branches page](/guides/git/#the-branches-page),
281open the branch's **⋯** menu and choose **Rename branch**.
282
283Renaming the default branch needs Admin. It stays the default under its
284new name. When a branch is renamed:
285
286- Open pull requests from it follow it to the new name.
287- Web addresses that name the old branch, such as
288 `g1t.sh/acme/rocket/tree/old-name`, redirect to the new one until a
289 branch with the old name is made again.
290- Git remotes do not follow. In each clone, rename the local branch and
291 track the new one:
292
293```sh
294git branch -m old-name new-name
295git fetch origin
296git branch -u origin/new-name new-name
297git remote set-head origin -a
298```
299
300From the API, call
301[`POST /repos/{owner}/{name}/branches/{branch}/rename`](/reference/api/repositories/rename-branch/)
302with `new_name`. A branch name with slashes goes in the path URL-encoded,
303as one segment: `feature/login` is `feature%2Flogin`.
304
305```sh
306curl -X POST https://api.g1t.sh/repos/acme/rocket/branches/feature%2Flogin/rename \
307 -H "Authorization: Bearer $G1T_TOKEN" \
308 -H "Content-Type: application/json" \
309 -d '{"new_name": "feature/sign-in"}'
310```
311
312Over MCP, it is the `repository` tool's `rename_branch` action, with
313`repo`, `branch` and `new_name`.
314
315## Rename a repository
316
3171. Open the repository's **Settings → Repository**.
3182. Under **Name**, type the new name. It shows the new address.
3193. Choose **Rename**.
320
321A name is lowercase letters, digits, dots, hyphens and underscores, up to
322100 characters. It cannot start with a dot or end in `.git`, and no other
323repository in the workspace may have it, including one that was
324[recently deleted](#restore-a-repository).
325
326Everything stays with the repository: its git data, issues, pull requests,
327workflow runs, deployments, settings, secrets and webhooks. Its old address
328keeps working, the same way as after a
329[transfer](/guides/transferring-repositories/#old-addresses):
330
331| | Behaviour |
332| --- | --- |
333| Web pages | A permanent redirect (`301`) to the same page at the new address. |
334| `git clone`, `fetch`, `pull` and `push` | Redirected to the new remote. Git follows it and prints a warning each time. |
335| API and MCP | A call that names the repository by its old name runs against it under its new name. |
336
337Its project follows: a project that had the repository's name takes the
338new one, unless another project in the workspace already has it, and its
339deployed apps are built again under the new name while the old addresses
340redirect.
341
342A redirect stops as soon as a repository is made at the old address.
343Update your remotes rather than relying on it:
344
345```sh
346git remote set-url origin https://g1t.sh/acme/launcher.git
347```
348
349From the API, call
350[`POST /repos/{owner}/{name}/rename`](/reference/api/repositories/rename-repo/)
351with `name`:
352
353```sh
354curl -X POST https://api.g1t.sh/repos/acme/rocket/rename \
355 -H "Authorization: Bearer $G1T_TOKEN" \
356 -H "Content-Type: application/json" \
357 -d '{"name": "launcher"}'
358```
359
360Over MCP, it is the `repository` tool's `rename` action, with `repo` and
361`name`.
362
363## Change who can see a repository
364
365A public repository can be seen and cloned by anyone, signed in or not. A
366private one can be seen only by people with a
367[role](/guides/access-and-roles/) on it.
368
3691. Open the repository's **Settings → Repository**.
3702. Under **Danger zone → Change visibility**, choose **Make private** or
371 **Make public**.
3723. Read what changes, type the repository's full name (`<workspace>/<repo>`)
373 to confirm, and choose **Make private** or **Make public** again.
374
375A [fork](/concepts/forks/) is as visible as the repository it came from and
376cannot change on its own: [detach it](/guides/forking-repositories/#detach-a-fork)
377first. When a repository with forks is made public or private, its forks
378are detached and keep the visibility they had.
379
380| | Making it public | Making it private |
381| --- | --- | --- |
382| 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. |
383| Search and Explore | It is added to [search](/guides/search/) and Explore for everyone. | It leaves search and Explore for everyone outside the workspace. |
384| Link previews | Links to it show a preview card with its name and its project's description. | Links to it stop showing a preview card. |
385| 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). |
386
387Nothing else changes: its address, members, settings, secrets, webhooks
388and deployments stay as they are.
389
390From the API, call
391[`POST /repos/{owner}/{name}/visibility`](/reference/api/repositories/set-repo-visibility/)
392with `private` and its full name in `confirm`:
393
394```sh
395curl -X POST https://api.g1t.sh/repos/acme/rocket/visibility \
396 -H "Authorization: Bearer $G1T_TOKEN" \
397 -H "Content-Type: application/json" \
398 -d '{"private": true, "confirm": "acme/rocket"}'
399```
400
401Over MCP, it is the `repository` tool's `set_visibility` action, with
402`repo`, `private` and `confirm`. `private` on
403[`PATCH /repos/{owner}/{name}`](/reference/api/repositories/update-repo/)
404makes the same change without the confirmation, for people with Admin.
405
406## Archive a repository
407
408Archiving makes a repository read-only. Use it for work that is finished
409but should stay readable.
410
4111. Open the repository's **Settings → Repository**.
4122. Under **Danger zone**, choose **Archive**.
4133. Read what changes and choose **Archive** again.
414
415While it is archived:
416
417| | |
418| --- | --- |
419| Pushes and merges | Refused, whatever your role, and for agents too. |
420| Issues and pull requests | Locked. They stay readable. |
421| Workflows | Do not run. |
422| Settings | The ones that change the repository are turned off. |
423| Deployments | Keep serving. |
424| Who can see it | Unchanged. Anyone who could see it still can, and clone it. |
425
426Its page says it is archived, and so do its project's card on the
427workspace overview and its card on [Explore](/guides/search/#explore),
428with an **archived** label. To undo it, someone with Admin chooses **Unarchive**
429in the same place. Pushes, merges, issues, pull requests and workflows
430work again; nothing that was refused while it was archived runs
431by itself.
432
433From the API, call
434[`POST /repos/{owner}/{name}/archive`](/reference/api/repositories/archive-repo/)
435or
436[`POST /repos/{owner}/{name}/unarchive`](/reference/api/repositories/unarchive-repo/):
437
438```sh
439curl -X POST https://api.g1t.sh/repos/acme/rocket/archive \
440 -H "Authorization: Bearer $G1T_TOKEN"
441```
442
443Over MCP, they are the `repository` tool's `archive` and `unarchive`
444actions, with `repo`. The
445repository's `archived_at` field says when it was archived, and is null
446when it is not.
447
448## Delete a repository
449
450Deleting takes a repository away at once, but an owner can restore it for
45130 days. After that it is purged: removed for good, its git data with it.
452
4531. Open the repository's **Settings → Repository**.
4542. Under **Danger zone**, choose **Delete**.
4553. Read what happens, type the repository's full name
456 (`<workspace>/<repo>`) to confirm, and choose **Delete repository**.
457
458| | While it is deleted | When it is purged |
459| --- | --- | --- |
460| Its pages, git remote and API | Answer as if it did not exist, for everyone. | The same. |
461| Its name | Stays taken: no repository can be made at its address. | Free to use again. |
462| Workflows | Stop, and do not start. | |
463| Deployments | Taken down. Its `g1t.page` addresses stop serving. | Removed. |
464| Custom domains | Kept, and serve nothing. | Removed. |
465| Search | Drops it. | |
466| Webhooks | The workspace's webhooks are sent `repo.deleted`. | Sent `repo.purged`. |
467| Storage | Stops counting toward the workspace's storage. | |
468| Git data, issues, pull requests, settings, secrets | Kept, for restoring. | Removed, and cannot be recovered. |
469
470Its entries in the [audit log](/guides/audit-log/) are kept, as for
471anything else.
472
473From the API, call
474[`DELETE /repos/{owner}/{name}`](/reference/api/repositories/delete-repo/)
475with its full name in `confirm`. It returns the deleted repository with
476`purge_after`, when it will be purged:
477
478```sh
479curl -X DELETE https://api.g1t.sh/repos/acme/rocket \
480 -H "Authorization: Bearer $G1T_TOKEN" \
481 -H "Content-Type: application/json" \
482 -d '{"confirm": "acme/rocket"}'
483```
484
485Over MCP, it is the `repository` tool's `delete` action, with `repo` and
486`confirm`.
487
488To move a repository to another workspace instead of deleting it, see
489[transferring a repository](/guides/transferring-repositories/).
490
491## Restore a repository
492
493A workspace's recently deleted repositories are listed for its owners
494under **Recently deleted** in the workspace's **Settings → Repositories**,
495at `g1t.sh/<workspace>/-/repositories`, each with who deleted it and when
496it will be purged.
497
4981. Open the workspace's **Settings → Repositories**.
4992. Under **Recently deleted**, find the repository and choose **Restore**.
500
501It comes back at the address it had, as it was when it was deleted: git
502data, issues, pull requests, settings, secrets and webhooks. Its
503deployments are built again, and its custom domains serve them once they
504are live. Workflows run again for new work; they do not catch up on what
505they missed.
506
507From the API, list them with
508[`GET /workspaces/{workspace}/repos/deleted`](/reference/api/repositories/list-deleted-repos/)
509(the `repository` tool's `list_deleted` action over MCP), then call
510[`POST /repos/{owner}/{name}/restore`](/reference/api/repositories/restore-repo/)
511with the path it had (the `restore` action):
512
513```sh
514curl https://api.g1t.sh/workspaces/acme/repos/deleted \
515 -H "Authorization: Bearer $G1T_TOKEN"
516
517curl -X POST https://api.g1t.sh/repos/acme/rocket/restore \
518 -H "Authorization: Bearer $G1T_TOKEN"
519```
520
521### Purge a repository now
522
523To remove a deleted repository for good before its 30 days are up, and
524free its name:
525
5261. Open the workspace's **Settings → Repositories**.
5272. Under **Recently deleted**, choose **Delete permanently** beside it.
5283. Type its full name (`<workspace>/<repo>`) to confirm, and choose
529 **Delete permanently** again.
530
531This cannot be undone. From the API, call
532[`POST /repos/{owner}/{name}/purge`](/reference/api/repositories/purge-repo/)
533with its full name in `confirm`:
534
535```sh
536curl -X POST https://api.g1t.sh/repos/acme/rocket/purge \
537 -H "Authorization: Bearer $G1T_TOKEN" \
538 -H "Content-Type: application/json" \
539 -d '{"confirm": "acme/rocket"}'
540```
541
542Over MCP, it is the `repository` tool's `purge` action, with `repo` and
543`confirm`.
544
545A workspace whose only repositories are recently deleted ones can itself
546be [deleted](/guides/workspaces/#delete-a-workspace); they are purged with
547it.
548
549## When a change is refused
550
551| Response | Why | What to do |
552| --- | --- | --- |
553| `401 unauthenticated` | No token, or one that is not valid. | Send a personal access token. |
554| `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. |
555| `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. |
556| `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. |
557| `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. |
558| `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. |
559
560Each refusal comes with a message that says what to do.
561
562## From the API and MCP
563
564| Route | MCP | What it does |
565| --- | --- | --- |
566| [`GET /repos/{owner}/{name}/languages`](/reference/api/repository-insights/get-languages/) | `repository` `languages` | Its languages by bytes, with `color` and `percent`. |
567| [`GET /repos/{owner}/{name}/contributors`](/reference/api/repository-insights/list-contributors/) | `repository` `contributors` | Its contributors with `kind`, `commits` and `weeks`. |
568| [`GET /repos/{owner}/{name}/license`](/reference/api/repository-insights/get-license/) | `repository` `license` | Its license's `spdx_id`, `name` and `path`. |
569| [`GET /repos/{owner}/{name}/stargazers`](/reference/api/stars/list-stargazers/) | `repository` `stargazers` | Who starred it, newest first. |
570| [`PUT /user/starred/{owner}/{name}`](/reference/api/stars/star-repo/) | `repository` `star` | Star it. `DELETE` takes the star back; `GET` says whether you did. |
571| [`GET /user/starred`](/reference/api/stars/list-starred/) | `repository` `list_starred` | What you starred. |
572
573Answers read from the default branch say which `commit` they are for and
574the `head` now; `pending` is true until the first is read. Stars take the
575`account:read` and `account:write` scopes; the rest `repo:read`.
576
577## Events and the audit log
578
579Each change is sent to [webhooks](/guides/webhooks/#events) and recorded
580in the [audit log](/guides/audit-log/):
581
582| Change | Event |
583| --- | --- |
584| Website, topics, protection | `repo.updated` |
585| Visibility | `repo.visibility_changed` |
586| Rename | `repo.renamed` |
587| Default branch | `repo.default_branch_changed` |
588| Branch rename | `branch.renamed` |
589| Branch made or deleted | `git.push`, `git.deleted`; in the audit log, `branch.created`, `branch.deleted` |
590| Archive, unarchive | `repo.archived`, `repo.unarchived` |
591| Transfer | `repo.transferred` |
592| Delete, restore, purge | `repo.deleted`, `repo.restored`, `repo.purged` |