From 50d1e340255fb83f21612d49f08981fc6948e132 Mon Sep 17 00:00:00 2001 From: qiyu <1693710928@qq.com> Date: Fri, 21 Nov 2025 08:34:47 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20git2.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git2.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/git2.txt b/git2.txt index e69de29..84d7d64 100644 --- a/git2.txt +++ b/git2.txt @@ -0,0 +1,13 @@ +# 克隆旧仓库 +git clone --mirror https://github.com/username/old-repo.git +cd old-repo.git(cd到旧仓库镜像目录) + +# 设置新仓库为远程仓库 +git remote set-url origin https://github.com/username/new-repo.git + +# 推送所有分支和标签到新仓库 +git push --mirror + +# 清理本地镜像(可选,或者直接删除文件夹) +cd .. +rm -rf old-repo.git \ No newline at end of file