admin 发表于 2024-8-22 17:06:03

网络问题导致 Git 提交失败,如何解决?

问题描述
我使用 Visual Studio Code 在本地开发项目,但在上传代码时经常遇到错误,有时好有时坏。
错误示例
https://linux.do/uploads/default/original/3X/8/9/8926a642ea42884a1eb2c28d57c6d6c0ef57c05e.png

Git 错误信息
以下是部分错误信息:

https://linux.do/uploads/default/original/3X/3/d/3d68697e772ef97017b1d090cd2abddf8d208f80.png

https://linux.do/uploads/default/original/3X/0/6/06105d9fa60811e5ed09e4c5fe42b0f002d05e3a.png

> git pull --tags origin main
fatal: unable to access 'https://github.com/LXJGZS/ltmt.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

Ping Github 结果
~$ ping github.com
PING github.com (140.82.112.3) 56(84) bytes of data.
64 bytes from gist.github.com (140.82.112.3): icmp_seq=1 ttl=47 time=238 ms
64 bytes from gist.github.com (140.82.112.3): icmp_seq=2 ttl=47 time=238 ms
64 bytes from gist.github.com (140.82.112.3): icmp_seq=3 ttl=47 time=246 ms
64 bytes from gist.github.com (140.82.112.3): icmp_seq=4 ttl=47 time=246 ms
--- github.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 238.087/242.208/246.362/3.997 ms
Hosts 文件内容
127.0.0.1        localhost
# The following lines are desirable for IPv6 capable hosts
::1   localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# Generated by hosts-generator start
185.199.109.154   github.githubassets.com
140.82.113.21   central.github.com
185.199.108.133   desktop.githubusercontent.com
185.199.108.153   assets-cdn.github.com
185.199.110.133   camo.githubusercontent.com
185.199.108.133   github.map.fastly.net
146.75.93.194   github.global.ssl.fastly.net
140.82.112.3      gist.github.com
185.199.109.153   github.io
140.82.112.3      github.com
140.82.114.5      api.github.com
185.199.108.133   raw.githubusercontent.com
185.199.111.133   user-images.githubusercontent.com
185.199.110.133   favicons.githubusercontent.com
185.199.108.133   avatars5.githubusercontent.com
185.199.109.133   avatars4.githubusercontent.com
185.199.108.133   avatars3.githubusercontent.com
185.199.108.133   avatars2.githubusercontent.com
185.199.108.133   avatars1.githubusercontent.com
185.199.108.133   avatars0.githubusercontent.com
185.199.109.133   avatars.githubusercontent.com
140.82.113.9      codeload.github.com
52.216.53.9       github-cloud.s3.amazonaws.com
3.5.29.42         github-com.s3.amazonaws.com
52.217.228.57   github-production-release-asset-2e65be.s3.amazonaws.com
52.217.119.9      github-production-user-asset-6210df.s3.amazonaws.com
3.5.25.30         github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.109.153   githubstatus.com
140.82.113.18   github.community
185.199.108.133   media.githubusercontent.com
# 8/21/2024, 4:24:40 PM
#https://github.com/fliu2476/gh-hosts.git
# Generated by hosts-generator end

希望各位能够帮助解决问题。
页: [1]
查看完整版本: 网络问题导致 Git 提交失败,如何解决?