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 git-scm.com) 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
- (smaller file) The only file in the repo is 20KB in size, OR
- (use MS client and server) Instead of using the regular git client (1.9.5.msysgit.1), I use Visual Studio 2013, OR
- (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:
- The TFS server does not like how the msysgit client sends the credentials. (But then why does it work fine for smaller files?)
- TFS does an extra credentials check for large files
- 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.
WE FIGURED OUT A SOLUTION!
The latest stable git client that you currently get from git-scm.com is version 1.9.5 and is three months old. If you use the current release candidate version 188.8.131.52 (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 git-scm.com . Saeed pointed me in the right direction. Thank you very much Saeed! You were incredibly helpful!