将Git 项目迁移到另一个仓库

1、创建旧仓库的裸克隆

git clone --bare https://github.com/exampleuser/old-repository.git

执行上述命令后,会在本地生成一个名叫 old-repository.git的文件夹。

2、迁移到新仓库

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

这样的话,项目就已经迁移到新仓库了。

注意,我们不需要手动新建一个空的新仓库,当我们执行上述命令之后,新仓库就已经自动创建好了。

相关文章:

  • 2019-06-04
  • 2022-12-23
  • 2022-01-31
  • 2021-05-14
  • 2018-10-24
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-05-07
  • 2021-11-25
  • 2021-08-31
  • 2021-06-09
相关资源
相似解决方案