2015-07-01 28 views
2

我有一个git仓库,在一开始工作正常(或在Windows上可以预期),但1周后(或左右)回购速度变慢,当我尝试运行git fetch(以及任何使用fetch的命令)。终端冻结了几分钟,然后取回开始,取回本身不是特别慢,但等待时间使它很痛苦。在开始之前在窗口上等待Git获取

我曾尝试:

  • 我的病毒程序的车削
  • git config --global core.preloadindex true
  • git config --global core.fscache true
  • git config --global gc.auto 256
  • 再次关闭所有其他应用程序
  • 检查出库(适用于几天,然后我回来)。
  • git gc --aggressive --prune=now

任何人有什么更多的,我可以试试,我曾尝试谷歌,但还没有找到一个解决方案,我的神秘任何想法。

修改(2015-07-02):将git gc --aggressive --prune=now添加到测试列表中。

我已经运行:

GIT_TRACE=true git pull 
trace: exec: 'git-pull' 
trace: run_command: 'git-pull' 
trace: built-in: git 'rev-parse' '--git-dir' 
trace: built-in: git 'rev-parse' '--is-bare-repository' 
trace: built-in: git 'rev-parse' '--show-toplevel' 
trace: built-in: git 'ls-files' '-u' 
trace: built-in: git 'symbolic-ref' '-q' 'HEAD' 
trace: built-in: git 'config' 'branch.develop.rebase' 
trace: built-in: git 'config' 'pull.rebase' 
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD' 
trace: built-in: git 'fetch' '--update-head-ok' 
trace: run_command: 'ssh' '-p' 'port' '[email protected]' 'git-upload-pack '\''/repo'\'' 
' 
trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' 

#### WAITING for 2 minutes #### 

remote: Counting objects: 59063, done 
remote: Finding sources: 100% (124/124) 
... 

我已标记,其中等待时间。

+0

你试过'git gc'吗? – madhead

+0

试试这个:'git gc --aggressive --prune = now'。它会清理并打包所有松散的文件。 !!!!警告 - 它可能会删除未提交的内容 – CodeWizard

+0

'git gc --aggressive --prune = now'不起作用。 – Aircleaner

回答

1

如果延迟在git pull执行(在客户端上)和来自服务器的远程消息之间说remote: counting objects,那么它在服务器端是您需要解决的碎片。

运行git gc --aggessive将远程存储库打包到您要从中提取的git服务器上的一个或几个包文件。这些将比选择的对象更有效地加载,并且反过来可能会影响获取过程的工作速度。

您运行远程服务器的机器也可能具有某种反病毒扫描程序,它会触发Git服务器加载的每个文件;你有更多的文件(和更多的碎片)问题会更大。

编辑:更新答案以指示git gc需要运行的位置,因为碎片存储库是从其中拉取的,而不是拉到的。

+0

'git gc --aggressive --prune = now'不起作用。 – Aircleaner

+0

如果问题出现在服务器上,我如何进行全新结帐后,回购协议如何正常工作? 我没有管理权限在服务器上运行命令,我知道服务器不运行防病毒程序。 – Aircleaner

相关问题