将本地Git仓库推送到新的远程(包括所有分支和标签)

如果目标仓库为空,切换到空文件夹,然后:


git clone --bare https://your-source-repo/repo.git 
git push --mirror https://your-destination-repo/repo.git

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

另外,转载一篇相同的解决方案:https://baijiahao.baidu.com/s?id=1683503536008330063&wfr=spider&for=pc

第1步:

git clone -- bare xxxx1

xxx1:为原来git地址,就是你要迁移的地址

这一句主要是把代码基础包下载下来

第2步

第一步结束后,回你生成xxx2.git

cd xxx2.git

第3步

git push --mirrir xxxx3地址

xxx3:是你要往哪迁移的git地址

附:截屏

 

 

 
 
posted @ 2023-03-10 16:42  一两米  阅读(141)  评论(0编辑  收藏  举报