解决windows下git出现fatal: unable to access无法push/pull的问题

如果网络环境无法直接进入github, 首先需要一个代理软件

  • 打开代理, 确保能进入github

  • 输入 git config --global -l查看

http.proxy=

http.https://github.com.proxy=

http.proxy=
  • 检查=之后的代理号是否与Windows设置-> 网络和Internet->手动设置代理中的默认代理相同

  • 不相同, 输入:

git config --global http.proxy 127.0.0.1:<默认端口>
git config --global https.proxy 127.0.0.1:<默认端口>
git config --global http.https://github.com.proxy 127.0.0.1:<默认端口>
  • 记得删<>

  • 保证直接使用本地端口连接

如果能够不使用代理直接进入, 输入 git config --global -l查看

http.proxy=

http.https://github.com.proxy=

http.proxy=
  • 确保Windows设置-> 网络和Internet->手动设置代理没有打开

  • 检查=之后的代理号是否与Windows设置-> 网络和Internet->手动设置代理中的默认代理相同

  • 如果相同, 输入

git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset http.https://github.com.proxy

解除代理, 并输入ipconfig /flushdns刷新缓存

posted @ 2025-11-12 00:54  妲丽安的书架  阅读(2)  评论(0)    收藏  举报