+import namespace moves a whole repository into Code Storage in one push. To reach it, insert
+import before .git in the repository URL:
- It accepts a push only. A
git cloneor agit fetchagainst the import URL returns an error that tells you to use the normal repository URL. - An import push creates normal branches. Code Storage does not hide the refs. A normal
git cloneshows every branch you pushed. - A synced repository cannot use it. Code Storage refuses an import push to a repository that has a sync base, so an imported ref never reaches a connected GitHub repository.
git clone excludes an
ephemeral ref but includes an imported ref.
Use +import when:
- You must import many repositories at once
- You will not use the repositories immediately
- You must keep disk use low during the import
Code Storage enqueues cold archival on a push only. Use the normal repository URL to clone, fetch,
or pull. Code Storage thaws an archived repository before the read.
Setup
Add a named remote when you import more than one branch:Quick start
Create the repository first, then push to the import remote:SDK workflow
Generate a JWT-authenticated import URL with the SDK. Use the URL with standard Git commands:Bulk import
To import many repositories, read each item in your source list. Push each repository through the import remote:How it works
When you push to a+import remote:
- The gateway receives the pack
- The gateway unpacks the pack
- Code Storage sends the objects to all three storage nodes, as it does for a normal push
- Code Storage immediately enqueues a cold-storage job
- Code Storage sends the repository to object storage (S3)
- Code Storage removes the repository from hot disk
- Code Storage detects that the repository is cold and thaws it automatically
- The thaw time depends on the repository size. The client receives a message to retry until the thaw is complete
URL format
The import remote URL follows the same pattern as other namespaced remotes:Caveats
- Still fans out first: Code Storage copies the push to all storage nodes before cold archival. You cannot skip replication.
- Reads trigger thaw: A later clone or fetch thaws the repository. The first read takes more time.
- Push only: The import URL rejects read commands with this error:
reads are disabled for +import remotes; use the repository remote for clone/fetch. Use the normal URL to read the repository.