As shown in the figure below, this error occurs when I try to clone someone else’s repo. When I clone from git: /, instead of HTTPS://, it works well.
This happens because the agent is configured in GIT. Since it’s an HTTPS proxy (not HTTP) git config http.proxy And git config — Global http.proxy It doesn’t help.
Solution 1
1. Look at your git configuration
git config –global -l
If you don’t have any content related to the HTTPS proxy, such as HTTPS_ Proxy =… That’s not the problem.
If you have any content related to the HTTPS proxy, please remove it from the ~ /. Gitconfig file and try again.
2. If it still doesn’t work, unset the environment variable
env|grep -i proxy
You should have one or more lines_ proxy = …
Use the following to cancel settings one by one: cancel settings_ Proxy (or HTTPS)_ Proxy, depending on the name of the variable)
3. Check the environment variables again
env|grep -i proxy
If it doesn’t show anything, you should be good.
Note: this solution can be applied to HTTP and HTTPS proxy problems. Only the variable name is changed from HTTPS to http.
Solution 2
On the premise of opening shadowlocks, manually configure git agent. Git client can input the following two commands.
git config –global http.proxy http://127.0.0.1 :1080
git config –global https.proxy http://127.0.0.1 :1080
Http:// can also be changed to sockets5://, but the difference is that Socks5 does not support password free login to GitHub through pubkey, and only user name and password can be entered for each code submission. HTTP can support password free login.
Cancel agent:
git config –global –unset http.proxy
git config –global –unset https.proxy
In fact, plan 1 and plan 2 are the same method, but plan 2 is more specific. Most problems can be solved by plan 2. When plan 2 is invalid, plan 1 should be considered.
reference: https://stackoverflow.com/questions/24543372/git-cannot-clone-or-push-failed-to-connect-connection-refused
Read More:
- fatal: unable to access ‘https://github.com/xxx‘: Failed to connect to github.com
- Installation pyenvreward: fatal: unable to access ‘ https://github.com/pyenv/pyenv.git/ ‘
- Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed
- git clone appears fatal: index-pack failed problem solution
- unable to access ‘https://github.com/facebook/react-devtools/‘:
- Git command line configuration and configuration file to solve clone error libressl_ connect: SSL_ ERROR_ SYSCALL in connection to github. com:443
- The idea code pushes to GitHub and reports an error fatal: unable to access
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- [Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’
- NPM installØin sprintf- [email protected] Wealth: not available https://github.com/nhn/raphael.git/ “
- How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict
- git clone https:// gnutls_handshake() failed: The TLS connection was non-properly terminated.
- Problem solving: failed to connect to github.com port 443: Operation timed out(2020.06.04)
- Resolve git clone error fatal: http request failed
- SSL_ERROR_SYSCALL in connection to github.com:443
- Git authentication failure solution, due to the problem of password modification
- LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- pycharm Failed to connect to github.com port 443: Timed out
- Solution for GitHub unable to open pictures