10

使用 git push –mirror 迁移 Git 项目

 2 years ago
source link: http://i.lckiss.com/?p=7230
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用 git push –mirror 迁移 Git 项目

2021-07-19

从 Gogs 切换到 Gitea 迁移了不少仓库,记录下命令。

  • 使用 git bare 的方式拉下来旧仓库的代码,bare 能拉下来所有项目信息包括分支,TAG。
git clone --bare  your_project.git
  • 在新仓库上建立一个新项目,然后复制项目链接:
your_new_repository.git
  • 使用 git mirror 的方式直接推送到新的仓库地址。
git push --mirror your_new_repository.git

然后会发现,新仓库中的项目已与老项目保持一致,迁移的使用过程中才发现,Gogs 的 bug 真多。

参考 Github 官方文档:

Duplicating a repository


  • 2021051300031389.jpg

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK