Git push会挂起一个大型资料库 [英] Git push hangs for a large repository

查看:132
本文介绍了Git push会挂起一个大型资料库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在最近几天解决这个问题。



首先,我正在使用代理服务器,我已经使用连接Cntlm和我已经尝试在我的Visual Studio Online帐户上创建一个小型资源库,并且所有事情都按预期工作,我可以克隆和推送。



我已创建另一个版本库,这次更大(整个回购约800MB),当我试图推动。它让我通过身份验证周期,然后它挂起(我把它挂了24小时,没有任何反应)。我已经将git的 postBuffer 增加到524288000,正如其他地方所建议的那样,但是这并没有帮助。

'set

  GIT_CURL_VERBOSE = 1 

然后当我运行时:

  git push origin master -v 

code>

这是卡住的地方:

 > POST / DefaultCollection / _git / PROJex / git-receive-pack HTTP / 1.1 
授权:基本ZGRpbWl0cm92OkQxbxxxxxx
用户代理:git / 1.9.2.msysgit.0
主机:[user] .visualstudio.com
Accept-Encoding:gzip
Content-Type:application / x-git-receive-pack-request
接受:application / x-git-receive-pack-result
Content-Length:37423253

*到本地主机的连接#1完好无损

我发现内容长度比小回购显着大。我还应该注意到有500多个提交日志。



现在我认为这可能是一个代理问题,所以我在没有代理的情况下在不同的网络上尝试了它,我得到了同样的结果。除了http(s)以外的任何其他内容都不是我的设置中的选项。 解决方案

选项(出于任何原因),那么您可以考虑将相同回购的 捆绑 服务器和从该捆绑中获取(在服务器上)。也就是说,如果您有权访问服务器。



转让因为 git bundle 只会生成一个文件






另一种选择(如果你没有访问服务器的话)是将你的push分成几个较小的:

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

您可以尝试:

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

每次都会推送所有提交,直至您引用的提交。

最后,最后一次推动是一个增量推动,比推动所有事情小得多。


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.

解决方案

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.

这篇关于Git push会挂起一个大型资料库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆