git push hangs when windows git client pushes to TeamFoundation Git Server

Look at the bottom of this blog post for the solution to this issue.

I’m using the regular Windows git client (1.9.5.msysgit.1 downloaded from to push a repository with a 46KB file to a remote repository that is a Team Foundation Server Git repository.

When I do “git push” the console hangs for about 5 minutes (sometimes more) and then gives me a 401 error:

$ ls -la
total 29
drwxr-xr-x 4 pliska Administ 4096 Jun 22 14:02 .
drwxr-xr-x 13 pliska Administ 4096 Jun 19 11:40 ..
drwxr-xr-x 12 pliska Administ 4096 Jun 22 14:03 .git
-rw-r--r-- 1 pliska Administ 46157 Nov 19 2014 46KB.vsix

$ git push origin master -f
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 45.01 KiB | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)

The console hangs here for at least 5 minutes, after which I get these new lines:

error: RPC failed; result=7, HTTP code = 401
fatal: The remote end hung up unexpectedly
Everything up-to-date

I know my credentials are correct. When I enter wrong credentials I get an immediate error and don’t even see the first line from git push (the “Counting Objects” line).

I have been able to get this to work when

  1. (smaller file) The only file in the repo is 20KB in size, OR
  2. (use MS client and server) Instead of using the regular git client (1.9.5.msysgit.1), I use Visual Studio 2013, OR
  3. (use non-MS client and server) I push to a github remote (like this one).

From the three facts above. I’m thinking some of these things might be the cause of the issue:

  1. The TFS server does not like how the msysgit client sends the credentials. (But then why does it work fine for smaller files?)
  2. TFS does an extra credentials check for large files
  3. The TFS server has a setting that is not allowing large pushes into it. (But then why does it return a 401 error?)

After I commented on this Microsoft blog, Saeed from Microsoft suggested I use fiddler to see what is going on at the network level. I’m seeing the following:


We’re still not sure what this means, I need to research further. Saeed mentioned he has seen this when there is a misconfigured load balancer or proxy in the network, but my TFS server is not behind any of those. I’ll see if I can remote into the box and push directly to the local server just to see what happens.

I’ve googled this issue quite a bit and from this post’s suggestion, I ran the following command: git config http.postBuffer 524288000. Did this not fix it.

This page suggested this command: git config –global sendpack.sideband false . It also had a hex editor hack, I tried both with no success.


The latest stable git client that you currently get from is version 1.9.5 and is three months old. If you use the current release candidate version (you can download it here), things work fine.

I didn’t know this build existed, I don’t think a link exists to it from . Saeed pointed me in the right direction. Thank you very much Saeed! You were incredibly helpful!


3 thoughts on “git push hangs when windows git client pushes to TeamFoundation Git Server

  1. Reblogged this on faalon and commented:
    I ran into this problem with Git 1.9.5. Downloading the 2.4.x version fixed my problem, although I had to copy my .bashrc file over to .profile. I also had to aim my ConEmu at the “Program Files” version of Git as it moved from the “Program Files (x86)” folder (I downloaded the 64-bit version).

  2. Pingback: git push hangs for no apparent reason | My Software Notes

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s