gitee-to-github-migration

Migrates Git repositories from Gitee to GitHub using gh CLI and remote reconfiguration.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill gitee-to-github-migration-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitee-to-github-migration
Source: https://github.com/ZHLX2005/sl/tree/main/skills/gitee-to-github-migration
Command: npx skills add https://github.com/ZHLX2005/sl --skill gitee-to-github-migration-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Moving a project from Gitee to GitHub involves error-prone Git remote manipulation, and common pitfalls like misspelled remotes (orgin), existing repositories, and rejected pushes can block the migration. ## Core Features & Use Cases - Full Migration Workflow: Verify gh CLI authentication, remove old Gitee remotes, create a GitHub repository, and push code in one guided sequence. - Remote Reset Scenario: When an admin has already created the GitHub repository, reset local remotes and pull with rebase using a single command. - Error Case Handling: Covers common failures such as cannot lock ref errors, orgin spelling residue, duplicate remotes, and pre-existing repositories. - Use Case: A developer whose team is moving off Gitee runs the guided steps to delete stale remotes, create the GitHub repo with gh repo create, and verify the push succeeded. ## Quick Start Ask the assistant to migrate this local repository from Gitee to GitHub and verify the new remote points to GitHub.

Frequently Asked Questions about gitee-to-github-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a repository from Gitee to GitHub?

Verify gh CLI login with gh auth status, remove existing remotes with git remote remove, then run gh repo create <name> --public --source=. --push to create the GitHub repository and push your code in one step.

How to reset git remote to point to GitHub instead of Gitee?

Remove the old remotes with git remote remove origin and git remote remove orgin, then add the GitHub URL with git remote add origin and pull with git pull origin main --rebase. Verify with git remote -v.

Why does git push fail with cannot lock ref refs/heads/main?

This error means the GitHub repository already exists with initial commits that conflict with your local history. The documented fix is git push -u origin main --force, but only after confirming the remote content can be overwritten.

What if git remote remove origin does not remove the Gitee remote?

The Gitee remote may be misspelled as orgin (missing the letter i), which is a common typo. Run git remote -v to list all remotes, then remove the misspelled one with git remote remove orgin.

Can I keep Gitee as a backup while adding GitHub?

Yes, instead of removing the Gitee remote, add GitHub as an additional remote with git remote add github <url>. You can then push to both remotes separately to keep Gitee as a backup copy.