由于在git bash中,用的是自己独立的一套系统,所以即使你打开代理也无法正常下载github内容到本地。

如下所示:

fatal: unable to access 'https://github.com/*/*.git/': Failedto connect to github.com port 443 after 21084 ms: Could not connect to server
 


故而有以下方式:
先在设置中检查自己的代理服务器的代理IP地址与端口:(具体在设置 ->网络与Intenet ->手动设置代理,点击编辑)  windows11系统
这里我的代理IP地址为127.0.0.1  端口为7890

修改配置的命令:在powershell或者gitbash命令中都可以
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

验证方式:
git config --global --get http.proxy
git config --global --get https.proxy

验证成功后就可以下载了。

此时执行 git clone https://github.com/*/*.git

在 Git Bash 中执行以下命令:
# 取消 HTTP 代理
git config --global --unset http.proxy

# 取消 HTTPS 代理
git config --global --unset https.proxy

Logo

openEuler 是由开放原子开源基金会孵化的全场景开源操作系统项目,面向数字基础设施四大核心场景(服务器、云计算、边缘计算、嵌入式),全面支持 ARM、x86、RISC-V、loongArch、PowerPC、SW-64 等多样性计算架构

更多推荐