Git仓库完全迁移,包括所有的分支和标签,当然也包括日志


一、删除原有远程仓库地址

git remote rm origin

二、添加新的仓库地址

cd existing_repo
git remote add origin <URL>

git push -u origin --all 
git push -u origin --tags
三、迁移

git clone --mirror <URL to my OLD repo location> cd <New directory where your OLD repo was cloned> git remote set-url origin <URL to my NEW repo location> git push -f origin
原文地址:https://www.cnblogs.com/cina33blogs/p/9375918.html