gitlib项目迁移到新Gitlab Server

隐身守侯 提交于 2019-12-04 10:42:10

上次的gitlab服务是用http的,这次我给gitlab加上了https支持,因为是自签名的证书,所以需要大家设置git的全局参数http.sslverify为false, 下面是设置此配置的command:

$ git config --global http.sslverify false

原来检出的项目需要修改它的remote才能提交到此repo上。下面以ssl-vpn这个项目为例:

首先查看当前的remote:

 $ git remote -v
origin  http://gitlab.china-ops.com/project/ssl-vpn.git (fetch)
origin  http://gitlab.china-ops.com/project/ssl-vpn.git (push)


删除`origin`这个remote,然后可以看到没有remote repo了。

$ git remote remove origin
 $ git remote -v


添加新的remote repo.

$ git remote add origin https://gitlab.china-ops.com/project/ssl-vpn.git


这样就可以push代码到新remote repo上了。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!