title: How is git push through network working? (proxy)
body: <p>I'm wondering how <code>git push</code> works. I'm behind a proxy and even configuring it in my PhpStorm soft doesn't work.</p>
  <p>So, I'm wondering how it is sent trough network, I guess using the port 80 for HTTP and 443 for HTTPS.</p>
  <p>I read a bunch of threads on SO but couldn't figure out what's wrong there.
  I guess &quot;my&quot; proxy doesn't have <strong>WebDAV</strong> enabled as explained here: <a href="https://stackoverflow.com/questions/4984433/cant-push-to-github-through-proxy">Can&#39;t push to github through proxy</a></p>
  <p>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.</p>
  <pre><code>git remote -vv
  origin  https://Vadorequest@bitbucket.org/Vadorequest/vadorequest.git (fetch)
  origin  https://Vadorequest@bitbucket.org/Vadorequest/vadorequest.git (push)
  </code></pre>
  <hr />
  <h1><strong>Solution:</strong></h1>
  <h2>Not secured proxy (http)</h2>
  <h3>If the proxy is not secure then you can configure it using:</h3>
  <p><code>git config --global http.proxy http://user:password@host:port</code></p>
  <h3>And disable it using:</h3>
  <p><code>git config --global --unset-all http.proxy</code></p>
  <h2>Secured proxy (https)</h2>
  <p><code>git config --global https.proxy https://user:password@host:port</code></p>
  <h3>And disable it using:</h3>
  <p><code>git config --global --unset-all https.proxy</code></p>
  <p>Note that if you are under Windows and using <strong>TortoiseGit</strong>, you can set the proxy settings from the software itself. (Network tab)</p>
  <p>If you're using <strong>Cygwin</strong> 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)</p>
  <p>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.</p>
  <p>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. <em>(<strong>i.e</strong>: 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)</em></p>