title: git push --all is failing on 'RPC failed; result=22, HTTP code = 0'
body: <p>I am having an interesting issue. I have a pet project on bitbucket and so far I was able to pull and push from two different networks (home and office). It took a while to set the configuration properly but I have figured it out with some try and error approach. Now the issue is that I have created a branch in the office (which is behind a proxy) and I can't push it to the bitbucket with the --all parameter. I am getting:</p>
  
  <blockquote>
    <p>RPC failed; result=22, HTTP code = 0</p>
  </blockquote>
  
  <p>Here is the git bash (modified):</p>
  
  <pre><code>user@machine /c/dev/data/personal/projectname (master)
  $ git push --all --dry-run
  Password for 'https://username@bitbucket.org':
  To https://username@bitbucket.org/username/projectname
   * [new branch]      ivymigration -&gt; ivymigration
  
  user@machine /c/dev/data/personal/projectname (master)
  $ git push --all
  Password for 'https://username@bitbucket.org':
  Counting objects: 194, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (112/112), done.
  Writing objects: 100% (116/116), 58.37 KiB, done.
  Total 116 (delta 81), reused 0 (delta 0)
  efrror: RPC failed; result=22, HTTP code = 0
  atal: The remote end hung up unexpectedly
  fatal: The remote end hung up unexpectedly
  Everything up-to-date
  
  user@machine /c/dev/data/personal/projectname (master)
  $ git config --global -l
  http.proxy=http://user:password@proxy:8080
  http.postbuffer=524288000
  user.name=[My Name]
  user.email=[my_name]@[my.domain]
  core.autocrlf=true
  push.default=upstream
  </code></pre>
  
  <p>I have tried stuff from <a href="https://stackoverflow.com/questions/7700824/rpc-failed-result-28-http-code-0">RPC failed; result=28, HTTP code = 0</a>
  but without success. Changing the https to git or git+ssh does not work either because of the proxy server. <strong>Interestingly the push worked so far fine without the --all attribute.</strong> But once I want to push all of it, including the new branch, the whole thing collapses.</p>
  
  <p>Any thoughts?</p>
  
  <p><strong>Update #1:</strong></p>
  
  <p>I have tried to push the branch following the instruction in <a href="https://confluence.atlassian.com/display/BITBUCKET/Branching+a+Repository" rel="nofollow noreferrer">https://confluence.atlassian.com/display/BITBUCKET/Branching+a+Repository</a> section 'How to branch in git' without success. Here is the git bash:</p>
  
  <pre><code>user@machine /c/dev/data/personal/projectname (master)
  $ git push origin ivymigration
  Password for 'https://username@bitbucket.org':
  Counting objects: 203, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (72/72), done.
  Writing objects: 100% (125/125), 70.79 KiB, done.
  Total 125 (delta 86), reused 88 (delta 49)
  efrror: RPC failed; result=22, HTTP code = 0
  atal: The remote end hung up unexpectedly
  fatal: The remote end hung up unexpectedly
  Everything up-to-date
  </code></pre>
  
  <p>As you can see I get the same error.</p>
  
  <p><strong>Update #2:</strong></p>
  
  <p>I have tried what Seth suggested and here is the result:</p>
  
  <pre><code>user@machine /c/dev/data/personal/projectname (ivymigration)
  $ GIT_TRACE=1 git push --all
  trace: built-in: git 'push' '--all'
  trace: run_command: 'git-remote-https' 'origin' 'https://username@bitbucket.org/username/projectname'
  Password for 'https://username@bitbucket.org':
  trace: run_command: 'send-pack' '--stateless-rpc' '--helper-status' '--thin' '--progress' 'https://username@bitbucket.org/username/projectname/' 'refs/heads/ivymigration:refs/heads/ivymigration'
  trace: built-in: git 'send-pack' '--stateless-rpc' '--helper-status' '--thin' '--progress' 'https://username@bitbucket.org/username/projectname/' 'refs/heads/ivymigration:refs/heads/ivymigration'
  trace: run_command: 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
  trace: built-in: git 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
  Counting objects: 203, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (72/72), done.
  Writing objects: 100% (125/125), 70.79 KiB, done.
  Total 125 (delta 86), reused 88 (delta 49)
  efrror: RPC failed; result=22, HTTP code = 0
  atal: The remote end hung up unexpectedly
  fatal: The remote end hung up unexpectedly
  Everything up-to-date
  </code></pre>
  
  <p>As you can see same result and no extra info related to the actual failure. So I have tried the second command. It failed because I am in Windows so there is no <code>strace</code> (<a href="https://stackoverflow.com/questions/3847745/systrace-for-windows">Systrace for Windows</a>). I have also tried to create a branch in the network without proxy (aka home) and were able to successfully <code>git push --all</code> from there. As I said before. I am able to <code>git push</code> from network behind proxy (aka office) but not able to do <code>git push --all</code>.</p>