I'm wondering how git push
works. I'm behind a proxy and even configuring it in my PhpStorm soft doesn't work.
So, I'm wondering how it is sent trough network, I guess using the port 80 for HTTP and 443 for HTTPS.
I read a bunch of threads on SO but couldn't figure out what's wrong there. I guess "my" proxy doesn't have WebDAV enabled as explained here: Can't push to github through proxy
But I would like to know if anything else could be the source of the issue here, knowing that all ports are closed, excepted 80, 22 and 443.
git remote -vv
origin https://Vadorequest@bitbucket.org/Vadorequest/vadorequest.git (fetch)
origin https://Vadorequest@bitbucket.org/Vadorequest/vadorequest.git (push)
Solution:
Not secured proxy (http)
If the proxy is not secure then you can configure it using:
git config --global http.proxy http://user:password@host:port
And disable it using:
git config --global --unset-all http.proxy
Secured proxy (https)
git config --global https.proxy https://user:password@host:port
And disable it using:
git config --global --unset-all https.proxy
Note that if you are under Windows and using TortoiseGit, you can set the proxy settings from the software itself. (Network tab)
If you're using Cygwin then be aware that if you set the global config it will be set only for the current environment. (Using cmd.exe will set it for Windows, but using the cygwin console will set it for cygwin only)
So, if you're using Git through an IDE (PhpStorm, WebStorm) be sure to have set the config in the environment used by the IDE, or it will not work.
Be also aware that if you have set the proxy in git setting and you're not behind the proxy, it will not work neither. (i.e: You've set it at work and it works fine, but when you're using it at home it doesn't work anymore while it used to work before)