2014-12-02 14:28:46
第三方仓库的服务质量或者性价比过低,想迁移到本站,本文提供一个快速迁移方案,只需要几分钟就可以完成迁移
git clone --bare https://github.com/test_user1/old_project.git
clone旧项目必须加上--bare,否则无法迁移!
本目录不能用于提交代码,只能用于迁移,后续验证迁移正常,则删除本目录。
在项目管理,创建一个项目,例如项目地址是http://repo.git.uujuju.com/git/test_user1/new_project1.git
cd old_project
git remote add remote_new "http://repo.git.uujuju.com/git/test_user1/new_project1.git"
git push --mirror remote_new
迁移后,新仓库的数据,会被旧仓库完全覆盖,请谨慎操作!
git clone http://repo.git.uujuju.com/git/test_user1/new_project1.git cd new_project1 验证数据是否正常,如正常,可以用于提交代码