ssh: connect to git@gitlab.xxxxx.com:xxxxx.git port 22: Connection refused

公司服务器上的gitlab项目添加了ssh密钥,但是操作时却报错ssh: connect to git@gitlab.xxxxx.com:xxxxx.git port 22: Connection refused

经过研究发现gitlab不仅支持ssh也支持http链接获取项目:

将原来的ssh链接git@gitlab.xxxxx.com:xxxxx.git改成https的链接https://gitlab.xxxxxxxxx.com/xxxxxxxxx.git就行了

比如git clone https://gitlab.xxxxxxxxx.com/xxxxxxxxx.git 会提示你输入账号密码,这个账号密码就是登陆你们公司gitlab服务器时用的账号密码

如果之前本地有项目了则执行下面代码

查看本地项目对应的远程链接:git remote -v

将git@gitlab.xxxxx.com:xxxxx.git改成https的链接https://gitlab.xxxxxxxxx.com/xxxxxxxxx.git:

git remote set-url origin https://gitlab.xxxxxxxxx.com/xxxxxxxxx.git

然后就能正常push pull fetch了

转载于:https://www.cnblogs.com/agilezhu/p/7039752.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值