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.

140 linesCodeBlameRaw
1---
2title: Transferring a repository
3description: Move a repository to another workspace, with its pull requests, deployments and history, while its old address keeps working.
4---
5
6Transferring moves a repository from one workspace to another. It keeps its
7name, and everything in it moves with it. Its address changes from
8`g1t.sh/<old>/<repo>` to `g1t.sh/<new>/<repo>`, and the old address keeps
9working as a redirect.
10
11To change only its name and keep it in its workspace,
12[rename it](/guides/managing-repositories/#rename-a-repository) instead;
13its old address redirects the same way. To be rid of a repository rather
14than move it, [delete it](/guides/managing-repositories/#delete-a-repository).
15
16## Who can transfer
17
18In the workspace the repository is in, you must be an **owner**, or a
19member with the Admin role on it when the workspace's
20[member privileges](/guides/workspaces/#member-privileges) let repository
21admins delete and transfer repositories (off by default). In the workspace
22it moves to, you must be an owner, or a member who may create a repository
23of its kind there. An access token that belongs to a workspace, or g1t's
24token, cannot transfer. Your email address must be confirmed.
25
26## Transfer a repository
27
281. Open the project's **Settings → General**.
292. Under **Danger zone**, choose **Transfer**. The project moves with its
30 repository.
313. Pick the workspace to move it to. Only workspaces where you can create
32 a repository like it are listed.
334. Read what changes, type the repository's full name (`<old>/<repo>`) to
34 confirm, and choose **Transfer**.
35
36You land on the repository's settings at its new address. Everything kept
37about it elsewhere in g1t (search, deployments and the rest) follows within a few seconds.
38
39From the API, call
40[`POST /repos/{owner}/{name}/transfer`](/reference/api/repositories/transfer-repo/)
41with the destination in `to`:
42
43```sh
44curl -X POST https://api.g1t.sh/repos/acme/rocket/transfer \
45 -H "Authorization: Bearer $G1T_TOKEN" \
46 -H "Content-Type: application/json" \
47 -d '{"to": "acme-labs"}'
48```
49
50Over MCP, it is the `repository` tool's `transfer` action, with `repo` and
51`to`. A token's owner must
52own both workspaces, as on the site.
53
54## When a transfer is refused
55
56| Response | Why | What to do |
57| --- | --- | --- |
58| `403 forbidden` | You do not own one of the two workspaces, or you are using a workspace token. | Ask an owner of both to transfer it, or use a personal token. |
59| `409 conflict` | The destination already has a repository with that name, or a recently deleted one held it. | Rename or move that repository first, or purge the deleted one. |
60| `402 payment_required` | The repository is private, the destination is on no plan, and its private repositories would hold more than a free workspace's 1 GB. | Start the g1t plan in the destination, or make the repository public first. |
61| `422 invalid` | No destination, or the destination is the workspace it is already in. | Name another workspace. |
62
63## What moves
64
65Everything that belongs to the repository moves with it:
66
67| | |
68| --- | --- |
69| Code | Every branch and tag. The git data does not move or copy; only the address changes. |
70| Pull requests | With their numbers, comments, reviews, sessions and merge queue. A new pull request takes the new workspace's next number, always above the numbers the repository's pull requests already have. |
71| Workflows | Workflow runs, their jobs, logs and artifacts. |
72| Deployments | The repository's project, its deployments and its custom domains. See [deployments](#deployments). |
73| Its own settings | Merge rules, branch protection and guardrails. |
74| Its own secrets and variables | Set on the repository, they move with it. |
75| Its own webhooks | They now name the repository by its new path. |
76
77These belong to the old workspace and stay with it:
78
79| | |
80| --- | --- |
81| Work items | [Work items](/guides/work-items/) belong to the workspace, so they stay in the old one, with their numbers. |
82| Labels and milestones | They are the workspace's, and stay with it. |
83| Workspace secrets and variables | The old workspace's stop reaching the repository; the new workspace's start, if they reach every repository or name this one. |
84| Workspace webhooks | The old workspace's stop hearing about the repository; the new one's start. |
85| Integrations | Sentry, Datadog, Jira and Linear connections stay with their workspace. Connect them in the new one if you need them there. |
86| Workspace guardrails | The new workspace's apply from now on. |
87| The audit log | What happened before the transfer stays in the old workspace's log. Each workspace's log records the transfer itself. |
88| Billing history | See [billing](#billing). |
89
90## Old addresses
91
92The old address keeps working, for as long as nothing else is made there:
93
94| | Behaviour |
95| --- | --- |
96| Web pages | A permanent redirect (`301`) to the same page at the new address, query string included. A private repository redirects only for people who can see it; anyone else gets a 404, as before. |
97| `git clone`, `fetch` and `pull` | Redirected to the new remote. Git follows it and prints a warning each time. |
98| `git push` | Redirected the same way: git asks for the push's refs at the old address, follows the redirect, and sends the push to the new one. |
99| API and MCP | A call that names the repository by its old path runs against it at its new path. |
100| `g1t.page` apps | The old app addresses redirect to the new ones for 90 days. |
101
102A redirect stops as soon as a repository is created at the old address,
103whether by the site, the API or a push that creates one. Update your
104remotes rather than relying on it:
105
106```sh
107git remote set-url origin https://g1t.sh/<new>/<repo>.git
108```
109
110Update anything else with the old address in it too: links in READMEs, CI
111configuration, API clients and MCP clients.
112
113If the old workspace is later [deleted](/guides/workspaces/#delete-a-workspace),
114its name is never given to anyone else, so the redirects keep working.
115
116## Deployments
117
118A `g1t.page` address ends in its workspace's name: production is at
119`<project>-<workspace>.g1t.page`. After a transfer, each of the project's
120apps (production and every open preview, including one paused by the old
121workspace's usage limit) is built again from the same commit under the new
122workspace's name. The old address keeps serving until the new one is live,
123then redirects to it for 90 days, whatever the old workspace's plan or
124limit. Custom domains move with the project and serve the new build.
125
126From the transfer on, the apps are the new workspace's: its plan and usage
127limit decide whether they build and serve. If the new workspace cannot
128build yet (Deployments are off, or it reached its limit), the rebuild waits
129and is tried again until it can.
130
131## Billing
132
133- Usage from the moment of the transfer is charged to the new workspace:
134 workflow jobs, builds, app traffic, git operations and storage.
135- What the repository used before stays on the old workspace's bill.
136 Runs already under way finish on the bill they started on.
137- Storage follows the repository: from the next daily count it is the new
138 workspace's private storage.
139- A public repository's share of the open-source pool this month moves
140 with it.