看似随机,我们的本地存储库无法再从我们的 Bonobo 服务器获取。当我们尝试在本地获取时,它发生在我们最大的远程 repo (大约 4GB)给不同的人和不同的时间。起初只是每隔几个月一次,但现在它的频率越来越高,今天同一时间发生在很多本地 repo 中。现在,我们正在通过移动工作 .git
文件夹来解决它。
它快速打印一些 POST git-upload-pack(gzip X 到 Y 字节)
,然后挂起半小时到一个小时。
如果我从 objects 目录中删除一个包文件,它会提示缺少东西然后开始正确获取,但仅限于那个 git-upload-pack
。
我用各种方法尝试了 repack
和 gc
都没有效果。我尝试将服务器和客户端上的 git 从 1.8.4 升级到 1.9。
clone
ing 有同样的问题,但升级 Bonobo 解决了这个问题,即使它是相同版本的 git。昨天新克隆的 repo 正在运行,但今天它有同样的问题。
有趣的是我们里面有很多 dll 和 pdb。它已经使用了一年,并且是使用 git-svn 从 SVN 存储库导入的。
这是痕迹
$ GIT_TRACE=1 git fetch -v
trace: built-in: git 'fetch' '-v'
trace: run_command: 'git-remote-https' 'origin' 'https://xxx
/yyy.git'
trace: run_command: '"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore
/git-credential-winstore.exe" get'
trace: run_command: '"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore
/git-credential-winstore.exe" store'
trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--in
clude-tag' '--thin' 'https://xxx/yyy.git/'
trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--i
nclude-tag' '--thin' 'https://xxx/yyy.git/'
POST git-upload-pack (gzip 2057 to 1096 bytes)
POST git-upload-pack (gzip 2307 to 1222 bytes)
POST git-upload-pack (gzip 3657 to 1914 bytes)
POST git-upload-pack (gzip 6207 to 3192 bytes)
POST git-upload-pack (gzip 12607 to 6374 bytes)
谷歌搜索显示有些人遇到了这个问题,但没有提及(升级倭黑猩猩等)。
最佳答案
git 内部使用 curl,因此使用以下配置设置进行调试:
客户端配置:
git config --global http.postBuffer 524288000
客户端环境变量:
- GIT_CURL_VERBOSE=1
- GIT_HTTP_MAX_REQUESTS=16
服务器配置:
- 增加
<requestLimits maxAllowedContentLength=
[想要的尺寸]>
在web.config
;大小可以是 1073741824 - 增加
<httpRuntime maxRequestLength=
[想要的尺寸]>
在web.config
;尝试值 1024000
此外,以下设置可以自动中止慢速传输:
- GIT_HTTP_LOW_SPEED_TIME
- GIT_HTTP_LOW_SPEED_LIMIT
If the HTTP transfer speed is less than GIT_HTTP_LOW_SPEED_LIMIT for longer than GIT_HTTP_LOW_SPEED_TIME, the transfer is aborted.
引用资料
- Git - Environment Variables
- Git - git-config Documentation
- Git source - http.c
- How can I debug git/git-shell related problems?
- Git - How to use .netrc file on windows to save user and password
- Bonobo Git Server - FAQ
- Bonobo Git Server - Changelog
- Rate limits
- Limits in AWS CodeCommit
- Scaling Bitbucket Server
- Bitbucket Server config properties
关于Git fetch 卡在 git-upload-pack 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27442134/