1,创建一个文件夹,cd进入文件夹后执行下面的命令。 这个命令会对原仓库 克隆一份裸版本库。然后会在文件夹下生成一份克隆后的git文件

git clone --bare https://github.com/LiShengP/zkkj_testGit.git 

2,进入到生成的git文件下

cd zkkj_testGit.git

3,  比如我们要把代码迁移到 码云平台,下面命令将克隆的裸版本库,镜像到目标仓库。

git push --mirror https://gitee.com/lishengpei/ZKKJNew2020.git

4,删除本地代码

cd ..
rm -rf zkkj_testGit.git


到新服务器 GitHub 上找到 Clone 地址,直接 Clone 到本地就可以了。

git clone https://gitee.com/lishengpei/ZKKJNew2020.git

相关文章:

  • 2021-11-18
  • 2021-07-20
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-08-15
  • 2021-09-26
  • 2021-12-08
猜你喜欢
  • 2021-07-17
  • 2018-10-24
  • 2022-02-09
  • 2021-10-15
相关资源
相似解决方案