准备工作:
1.在新的git地址上创建好项目,然后将新项目的git地址保留
2.创建一个空的文件夹,右击空白处,选择用git bash命令执行
执行内容:
1.代码克隆镜像到本地(http://xx.git是你的旧git地址)
git clone --mirror http://xx.git
2.进入到克隆下来的.git目录
cd xx.git
3.推送克隆下来的镜像到新地址(http://xx.git是你的新git地址)
git push --mirror http://xx.git
4.验证
刷新新地址的项目,发现代码已经有了并且以前的commit记录也都在
07-04
2424
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-02
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-10
3741
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-21
1956
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)