1、git仓库迁移git
1,从原仓库clone或pull到本地仓库服务器
git clone project_name 【old_remote_repository_address】url
2,在新的git建立一个新仓库。若是用gitolite搭建的git服务器,那么只须要在配置文件gitolite.conf上添加仓库和用户,而后push到服务器便可。rem
3,进入clone下来的本地仓库目录,将远程仓库地址修改成新的远程仓库地址it
project_name> git remote remove originast
project_name> git remote add origin【new_remote_repository_address】配置
4,将本地仓库文件push到新的远程仓库方法
project_name> gitpush origin master配置文件
2、修改远程仓库地址文件
两种方式,除了上面第3步的修改方法,还能够:
git remote set-url origin 【new_remote_repository_address】