Files
Demo1/git2.txt
2025-11-21 08:34:47 +00:00

13 lines
378 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 克隆旧仓库
git clone --mirror https://github.com/username/old-repo.git
cd old-repo.gitcd到旧仓库镜像目录
# 设置新仓库为远程仓库
git remote set-url origin https://github.com/username/new-repo.git
# 推送所有分支和标签到新仓库
git push --mirror
# 清理本地镜像(可选,或者直接删除文件夹)
cd ..
rm -rf old-repo.git