问题一:Failed to connect to gitlab.com port 443 after 21606 ms: Couldn't connect to server

问题描述:

在使用git进行推送gitlab仓库时,出现Failed to connect to gitlab.com port 443 after 21606 ms: Couldn't connect to server错误

问题解决:

先试着ping gitlab.com

image.png

修改DNS为自动获取

再次ping gitlab.com

image.png

git推送成功

问题二:添加.gitignore文件后,想要忽略已经追踪的文件需要删除该追踪文件才能正常忽略

如想忽略文件config.inc.php,该文件在之前的提交中是被追踪的,那么需要执行:

git rm --cached config.inc.php

之后再进行提交,就不会再追踪了

如果是文件夹,则是:

git rm -r --cached directory_name

问题三:error: RPC failed; curl 56 HTTP/2 stream 5 was reset

push时遇到错误:

error: RPC failed; curl 56 HTTP/2 stream 5 was reset
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

解决方法:

修改http.version

git config http.version HTTP/1.1
最后修改:2024 年 12 月 25 日
如果觉得我的文章对你有用,请随意赞赏