4

I'm trying to resolve this for the last couple of days.

First of all I'm working behind a proxy, I've setup a connection using Cntlm and I've tried creating a small repository on my Visual Studio Online account and everything works as expected, I'm able to clone and push.

I've created another repository, this time bigger (the whole repo is about 800MB) and when I tried to push. It takes me through the authentication cycle and then it just hangs (I've left it hanging for 24 hours and nothing happens). I've increased git's postBuffer to 524288000 as suggested elsewhere, but that didn't help.

Further more I've set

GIT_CURL_VERBOSE=1

Then when I run:

git push origin master -v

This is where it gets stuck:

> POST /DefaultCollection/_git/PROJex/git-receive-pack HTTP/1.1
Authorization: Basic ZGRpbWl0cm92OkQxbxxxxxx               
User-Agent: git/1.9.2.msysgit.0                             
Host: [user].visualstudio.com                         
Accept-Encoding: gzip                                       
Content-Type: application/x-git-receive-pack-request        
Accept: application/x-git-receive-pack-result               
Content-Length: 37423253      

* Connection #1 to host localhost left intact   

I see that the content length is significantly larger than with the small repo. I should also note that there is a 500+ commit log.

Now I thought it might be a proxy issue, so I tried it without a proxy on a different network and I got the same results. Anything other than http(s) is not an option in my setup.

Dimitar Dimitrov
  • 14,868
  • 8
  • 51
  • 79

1 Answers1

5

If pushing a all big repo isn't an option (for any reason), then you could consider transferring a bundle of that same repo on the server, and fetching (on the server) from that bundle. That is, if you have access to the server.

The transfer is made easier by the fact a git bundle only generates one file.


The other alternative (if you don't have access to the server) is to split your push into several smaller one:

A<-B<-C<-D<-E

You can try:

git push origin B:master
git push origin D:master
git push origin master

Each time, that would push all commits, up to the one you reference.
At the end, the last push would be an incremental one, much smaller than pushing everything.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I don't have access to the server (it's Visual Studio Online), but your second option sounds like something that might work. The problem is that first commit is about 400MBs itself. Not sure if it's going to resolve the issue. I tried removing the log (removed the .git) and did a `init` and tried pushing again - didn't work either. – Dimitar Dimitrov Jun 02 '14 at 07:14
  • @DimitarDimitrov Maybe you can split that first commit into smaller ones? (http://stackoverflow.com/a/6217314/6309, http://stackoverflow.com/a/4307158/6309) – VonC Jun 02 '14 at 07:16
  • Thanks for your help, yeah I believe that this is my only option at this point. I'm not a git expert apparently, could you perhaps show me how I can split the first commit (or even the current if that's possible) ? – Dimitar Dimitrov Jun 02 '14 at 07:22
  • @DimitarDimitrov this is based on `git rebase -i` that I referenced in my previous links. For rebasing the *first* commit, add `--root`, as I mention in http://stackoverflow.com/a/2309391/6309. – VonC Jun 02 '14 at 07:25
  • Aye, let me give it a shot. Have some reading to do on `git rebase` :) – Dimitar Dimitrov Jun 02 '14 at 07:28
  • @DimitarDimitrov yes, the rebase interactive allows you to *split* a commit. (also, reorder the commits, drop them, edit them, ...) – VonC Jun 02 '14 at 07:28