使用Idea进行git pull/ push项目报错:failed to push some refs to、unable to access、HTTP/2 stream 1 was not clos

使用 git 进行 clone 项目或者 使用git 进行 pull 项目,push项目,可能会遇到很多的问题,比如说:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/XXXXX.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
OpenSSL SSL_connect: Connection was reset in connection to github.com:443 
 Failed to connect to github.com port 443 after 21146 ms: Timed out

…等等等等,其实大部分的原因都是网络的原因,可以分成下面两种情况进行处理:

  1. 使用的有 代理软件 :至少是可以访问github 畅通无阻的,但是clone pull push时候不能使用,这是因为进行这些操作的时候并没有使用代理。
  2. 本身就没有使用代理,github的原因,有时候网络,不太能访问到,可以在网上找一些代理的ip和端口。

解决办法:

配置代理:

git config --global http.proxy socks5 127.0.0.1:7890
git config --global https.proxy socks5 127.0.0.1:7890
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

7890是当前代理的端口,如果不能使用的话,就换成当前大家使用的代理端口,可以在自己使用的代理软件中看一下端口是多少:
在这里插入图片描述
最后可以检查一下:

git config --global --get http.proxy
git config --global --get https.proxy

撒花🎉🎉🎉

  • 7
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WeChat098

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值