https://zhuanlan.zhihu.com/p/636418854
- Problem Description
As shown in the figure below, unable to git clone a repository from Github, reporting port 443 error
![]()
- Problem Analysis
The port set in Git is inconsistent with the system proxy and needs to be reset
- Solution
3-1. Open the Proxy Page
Open Settings → Network & Internet → Find Proxy
![]()
Record the current system proxy IP address and port number
As shown in the above figure, the address and port number are: 127.0.0.1:7890
3-2. Modify Git’s Network Settings
# Note to modify to your own IP and port number
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
![]()
- Conclusion
You can try cloning again (in fact, this mainly solves the problem of why the proxy still doesn’t work after setting up the VPN, hahaha)
- Postscript
When we access GitHub, we usually use a VPN (proxy), so when pushing code up, a VPN is also required. Without a VPN, the probability of successful push is very low, usually resulting in timeout errors, so setting a VPN improves the success rate of access;
Canceling the proxy is because accessing Gitee or others does not require a VPN, so the proxy needs to be turned off; or if you regret setting the proxy, you can also use this to cancel it
# Cancel proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
# View proxy
git config --global --get http.proxy
git config --global --get https.proxy