A Git hosting migration is more than copying a repository: use this phased checklist to preserve history, branches, releases, automation, secrets, packages, and contributor access while keeping rollback possible.
Overview
Moving a repository to a new developer hosting platform can look simple when the visible task is only changing a remote URL. In practice, a repository is connected to build pipelines, deployment environments, package registries, issue trackers, release downloads, webhooks, bots, signing systems, and human access. A successful migration transfers or deliberately replaces those connections rather than assuming they will follow the Git objects.
This checklist applies to a move between hosted Git services, a transition to self-hosted Git infrastructure, an organization merger, or a repository transfer to a new owner. Treat it as a controlled change with four phases: inventory, rehearsal, cutover, and verification. Keep a written migration record containing the source repository, destination repository, owners, dependencies, test results, and rollback decision points.
Before choosing a migration method, confirm what the destination can import and what must be recreated. Import tools differ in their treatment of issues, pull requests, discussions, releases, large files, protected branches, deploy keys, and automation settings. Read the current documentation for both platforms, check authentication requirements, and note API limits or import restrictions before scheduling the cutover.
Checklist by scenario
For a standard repository move
- Freeze the inventory. Record the repository URL, default branch, active branches, tags, submodules, Git LFS usage, release artifacts, package outputs, open issues, pull requests, required checks, webhooks, deploy keys, machine users, and integrations.
- Confirm ownership. Identify administrators, code owners, release managers, CI maintainers, deployment owners, and people responsible for secrets. Make sure destination permissions are ready before the first push.
- Create the destination repository. Match visibility, default branch expectations, issue tracking settings, merge rules, and repository name where possible. Do not initialize it with an unrelated README, license, or ignore file if you plan to push a complete history.
- Transfer all Git references. A mirror clone and mirror push are useful for preserving branches and tags, but verify the result rather than assuming every reference was copied. Check commit counts, branch names, annotated tags, signed tags, and the latest commit on important branches.
- Move large files deliberately. If the project uses Git LFS, verify that LFS objects were transferred and can be downloaded from a clean checkout. Review the Git LFS hosting guide before migrating repositories with substantial binary assets.
- Recreate automation. Copy workflow files, pipeline definitions, runner labels, protected environment rules, schedules, manual triggers, and deployment configuration. Treat CI variables and secrets as a separate migration task; they are usually not part of Git history.
- Update integrations. Repoint webhooks, status reporting, chat notifications, issue synchronization, dependency update tools, code scanning, deployment hooks, and external build services. Test delivery and authentication for each integration.
- Validate a clean build. Clone the destination into a new directory, install dependencies, run the normal test command, build release artifacts, and exercise a representative deployment path. A local working copy is not sufficient evidence because it may contain cached credentials or generated files.
For a move that includes CI/CD and deployment
Start by mapping every pipeline trigger to its source event: push, pull request, tag, release, schedule, or manual dispatch. Then map every output to its destination, such as a container registry, package registry, object store, deployment platform, or release page. This prevents a common failure mode in which builds pass but artifacts are published nowhere.
- Replace repository URLs in pipeline files, scripts, submodules, Docker build contexts, and deployment manifests.
- Recreate secret names and environment variables without exposing their values in logs or commits.
- Rotate credentials when ownership, organization boundaries, or trust relationships change.
- Re-register self-hosted runners and verify labels, network access, permissions, and isolation. Use the self-hosted Git runner security checklist for runner-specific review.
- Confirm that deployment environments still require the intended approvals and that rollback commands point to the new repository or artifact location.
- Run at least one test branch, one pull request, and one release-like flow before declaring the migration complete.
For an open-source project or public repository
Public projects have a wider dependency surface. Contributors may use the old clone URL, badges may point to old checks, documentation may link to old issue pages, and package consumers may expect a particular release location. Publish a migration notice with the new canonical URL, effective date, contribution instructions, and a contact for problems.
Preserve attribution and history, then review license and release processes at the destination. Check that license files, notices, contributor records, signed releases, and generated SBOMs remain available. The guides on open-source license compliance and SBOM review can help with release-focused verification.
Comparison of common migration paths
| Migration path | Best suited to | Primary strengths | Risks to check |
|---|---|---|---|
| Platform importer | Teams moving standard repositories with supported metadata | Can reduce manual setup for issues, users, and repository data | Import scope, identity mapping, API limits, and unsupported objects |
| Mirror clone and push | Git history, branches, and tags | Direct, repeatable, and independent of a platform UI | Does not automatically move issues, secrets, webhooks, permissions, or packages |
| API or scripted migration | Organizations with custom metadata or many repositories | Auditable and automatable with mapping rules | Rate limits, pagination, authentication changes, and partial failures |
| Dual-publish transition | Projects needing a longer contributor or consumer transition | Provides time to test the destination while keeping the source available | Drift between repositories, duplicate issues, and unclear canonical ownership |
What to double-check
History, references, and releases
Compare the source and destination explicitly. Confirm the default branch, protected branches, annotated and lightweight tags, commit signatures, submodule URLs, Git LFS objects, release notes, and downloadable artifacts. If the project uses a monorepo, verify that build paths and ownership rules still match the repository layout; the monorepo versus multirepo guide provides useful context for dependency boundaries.
Access and authentication
List human users, groups, bots, deploy keys, personal access tokens, application integrations, SSH keys, and service accounts. Grant the minimum required access at the destination, then test both read and write operations using representative accounts. Do not copy secrets into migration notes. Record where each credential is stored, its owner, its purpose, and its rotation or revocation plan.
Packages, images, and deployment targets
Repository migration does not necessarily migrate package versions or container images. Identify package names, registry endpoints, retention rules, pull credentials, and image references in deployment manifests. If you operate a private registry, verify access control and garbage-collection behavior using the container registry guide. For web applications, also review environment variables, domains, preview builds, and rollback paths in the Git deployment guide.
Redirects and communication
Where supported, configure redirects from the old repository URL. Update documentation, badges, package metadata, issue templates, contribution guides, API examples, and deployment documentation. A redirect helps browsers, but it does not update hard-coded remotes in developer machines or URLs stored in automation. Provide a short migration command for contributors and explain how long the old location will remain available.
Common mistakes
- Copying only the default branch. Feature branches, release branches, tags, and historical references may be needed for audits or maintenance.
- Assuming Git contains the whole project. Issues, pull requests, releases, packages, secrets, environments, and webhooks are platform data or external dependencies.
- Testing from an existing checkout. Cached dependencies and credentials can conceal a broken clone, missing LFS objects, or incorrect authentication.
- Changing URLs without checking scripts. Search source, documentation, CI configuration, submodules, container files, and infrastructure code for the old hostname and repository path.
- Reusing credentials indefinitely. A migration is a good point to remove obsolete deploy keys, revoke temporary tokens, and rotate credentials whose ownership has changed.
- Cutting over without a rollback boundary. Decide in advance which failures justify returning to the source, who makes that call, and how new commits or issues created during the transition will be reconciled.
- Deleting the source too early. Preserve a read-only copy or backup according to your retention requirements until builds, releases, integrations, and contributor access have passed verification.
For disaster recovery planning around a self-hosted service, pair this checklist with the self-hosted Git server backup guide. A migration plan and a backup plan solve different problems, but both should be tested before a high-impact change.
When to revisit
Review this checklist before every repository move, ownership transfer, organization merger, major hosting evaluation, or CI/CD redesign. Revisit it before seasonal planning cycles when teams are more likely to consolidate infrastructure, and whenever a platform changes its import capabilities, API limits, authentication methods, runner model, package registry, or redirect behavior.
At the end of each migration, turn the results into a reusable runbook. Record which steps were automated, which required manual verification, which integrations failed initially, and how long rollback remained viable. For the next move, begin with a dependency inventory and a rehearsal rather than with the final cutover.
Practical next step: choose one low-risk repository and create a migration worksheet today. Capture its branches, tags, integrations, secrets, packages, deployment targets, owners, and rollback plan. Run a clean-clone build against a temporary destination, compare the results, and only then schedule the production cutover.