git:进行push的时候没有反应

当使用git push遇到'Connection timed out'错误时,可能需要编辑.ssh/config文件,更改Host、Hostname、Port等设置。如果Gitlab登录账号变动,应先清除credential.helper缓存,再重新配置新账号密码。本文提供了详细的解决步骤。
摘要由CSDN通过智能技术生成

使用git push指令的时候没任何反应,过一段时候后输出:

ssh: connect to host 10.48.8.10 port 22: Connection timed out
fatal: Could not read from remote repository.

解决方式:

1. vim /root/.ssh/config

2. 输入以下内容:

host gitlab.com
  Hostname altssh.gitlab.com
  User git
  Port 443
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

-----------------------------------------------

gitlab登录账号(比如修改了密码)发生了变化,也会导致此种情况。

解决:

1。 控制台输出:git config --system --unset credential.helper

2. 重新配置新的账号和密码

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值