Skip to main content
To migrate a GitHub repository to a native repository on Entire with Git and the Entire CLI, make sure you copy and verify the Git data before switching your working checkout’s origin to Entire. Keep GitHub available as gh.

Migrate the Repository

You can migrate the repositories manually, from the CLI or just by prompting your AI agent to do it for you.

1. Prepare

The first step is to Install or update Entire, including git-remote-entire, and install Git. Then authenticate to GitHub over SSH or HTTPS and log in to Entire and choose an existing project:
Confirm the project’s region and your permission to create repositories. Choose an unused destination name.
Pause GitHub pushes and merges before taking the snapshot, and keep them paused until verification and the remote switch finish. These commands do not synchronize later writes.
Git LFS payloads and submodule repositories need separate handling. This workflow does not transfer them. If any source history uses Git LFS, stop and plan the payload migration before proceeding. Copying pointer files alone does not migrate LFS content. Review submodule URLs and migrate their repositories separately.

2. Download Branches and Tags

Use a separate bare snapshot to keep your working checkout untouched and then run the commands in one Bash session. Make sure to replace the source URL, project name, and destination name:
The explicit refspecs exclude pull request refs and GitHub’s generated merge queue branches. They also leave out custom refs. If you need them, complete Copy Custom Refs before continuing.

3. Create the Destination

Match the snapshot’s object format and set private visibility before uploading code:
Confirm that the repository reports state: active. Copy its entire:// clone URL from the creation output and set it in the same shell:
If creation times out, inspect the repository with entire repo view --authoritative --json before retrying creation. A timeout can leave a provisioned repository behind. A successful view command alone does not confirm readiness, you will need to check its state.

4. Copy and Verify the Git Data

Run Copy and Verify Refs below in the same Bash session. Those commands check that the destination is empty, push the default branch first, and create the remaining refs without overwriting existing refs.Continue only when the destination matches the snapshot, GitHub still matches the snapshot, and both repositories advertise the same default branch. Stop and inspect any failed or partially completed push. Do not force an overwrite or delete destination refs to make the comparison pass.

5. Protect the Default Branch and Check Access

Use DEFAULT_BRANCH from the verification commands:
This rule allows only Entire trail merges on the default branch. When creating the rule, omit --server-side-merge-only to allow ordinary pushes while blocking force pushes and deletion. Omitting the flag does not lower an existing rule; use --server-side-merge-only=false if you intentionally want to change an existing rule’s level.Confirm that the intended collaborators have access before switching. The migration does not copy GitHub permissions.

6. Switch the Working Checkout

These commands require a standard checkout with a direct GitHub origin, no separate push URL or custom push routing, and no existing gh remote. Inspect git remote -v and your Git configuration first. If your checkout uses a different setup, adapt its remote configuration separately.
Keeping the name origin preserves existing branch upstream configuration. Confirm that origin points to Entire, gh points to the source GitHub repository, and your local branches and uncommitted work remain intact. If a command fails, inspect the current remotes before continuing; do not repeat the whole block blindly.

Advanced Ref Copying and Verification

Copy Custom Refs

The basic workflow copies only branches and tags. To include custom refs, inspect their names and confirm that Entire supports each namespace. Do not fetch all refs indiscriminately. For example, to include Entire checkpoint refs, run this after downloading branches and tags, before copying to the destination:
Add that same pattern to REF_PATTERNS in the next section. The manifests and push loop will then include those refs. If you select another supported namespace, add its explicit fetch refspec and matching pattern too. Exclude refs/pull/*, refs/heads/gh-readonly-queue/*, and refs/heads/trunk-merge/*. Entire also reserves namespaces such as refs/remotes/*, refs/replace/*, refs/bisect/*, refs/internal/*, and refs/meta/entire/*; do not copy them. Supported refs/entire/checkpoints/* and refs/entire/policies/* subnamespaces are exceptions to the reserved refs/entire/* namespace. Do not use reserved root refs such as refs/entire/checkpoints.

Copy and Verify Refs

Run these blocks in order in the Bash session from the Manual tab. Stop if any command fails. Each manifest records the ref’s object ID and full name. --refs excludes the extra peeled entries that ls-remote can print for annotated tags. First, define the scope and capture the source’s default branch:
Check that the destination has no refs before importing. Push the default branch alone so Entire can establish it as the default branch, then push the remaining refs. An empty expected value in --force-with-lease=REF: permits creation only; it refuses to replace a ref that another writer created. Despite the flag’s name, these commands do not authorize overwrites.
Compare the destination with the snapshot and check GitHub again. The destination comparison covers the selected namespaces; the initial empty check and explicit pushes prevent this workflow from introducing other refs.
If a comparison fails, keep writes paused and inspect the differences. If refs match but the destination default branch differs, correct it through a supported administrative path and repeat verification. Git pushes do not transfer symbolic HEAD. Continue with protection and access checks only after all comparisons pass.

Recover from a Partial Push

Keep the snapshot and manifests. Compare each selected destination ref with expected.refs: leave matching refs alone, create only missing refs with the same empty leases, and stop on divergent or unexpected refs. Do not rerun the empty destination block against a partially imported repository. Recheck GitHub and repeat the final comparisons before switching remotes.

After Migration

Keep GitHub and the snapshot available until you accept the migration. Update other checkouts and CI separately. GitHub issues, pull requests, release records and assets, permissions, and replicas do not migrate with Git data. A copied tag does not include its GitHub release assets.