Mac / OSX上的Git速度非常慢 [英] Git is very slow on Mac / OSX

查看:502
本文介绍了Mac / OSX上的Git速度非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在我的Macbook上使用任何与Git相关的东西(全新的Macbook Pro与El Capitan)时,每个命令都需要几分钟的时间。我做了一个简单的


GIT_TRACE = 1 git stash



$ p
$ b $ pre $ 17 $ 04:27.460826 git.c:557 trace:exec:'git-隐藏'
17:04:27.463136 run-command.c:347 trace:run_command:'git-stash'
17:04:32.503827 git.c:348 trace:built-in:git'rev -parse''--git-dir'
17:04:34.521223 git.c:348 trace:built-in:git'rev-parse''--show-toplevel'
17:04 :35.527473 git.c:348 trace:built-in:git'config''--get-colorbool''color.interactive'
17:04:36.534443 git.c:348 trace:built-in:git 'config''--get-color''color.interactive.help''red bold'
17:04:37.538357 git.c:348 trace:built-in:git'config''--get- color''''reset'
17:04:38.544472 git.c:348 trace:built-in:git'update-index''-q''--refresh
17:04:39.567521 git.c:348 trace:built-in:git'diff-index''--quiet''--cached''HEAD''--ignore-submodules'' - '
17:04:40.578480 git.c:348 trace:built-in:git'diff-files''--quiet''--ignore-submodules'
17:04:41.595078 git.c :348 trace:built-in:git'update-index''-q''--refresh'
17:04:42.612776 git.c:348 trace:built-in:git'diff-index'' --quiet''--cached'HEAD''--ignore-submodules'''
17:04:43.621067 git.c:348 trace:built-in:git'diff-files'' --quiet''--ignore-submodules'
17:04:44.636720 git.c:348 trace:built-in:git'rev-parse''--verify''HEAD'
17 :04:45.642275 git.c:348 trace:built-in:git'rev-list''--oneline''-n''1''HEAD'' - '
17:04:46.648038 git .c:348 trace:built-in:git'symbolic-ref '-q''HEAD'
17:04:47.653633 git.c:348 trace:built-in:git'write-tree'
17:04:48.664282 git.c:348 trace:built -in:git'commit-tree''< hex_number>''-p''< hex_number>'
17:04:49.672125 git.c:348 trace:built-in:git'read-tree ''--index-output = / Users /< USER> /。git / index.stash.62412''-m''< hex_number>'
17:04:50.707740 git.c:348 trace :内置:git'diff''--name-only''-z''HEAD'' - '
17:04:51.737890 git.c:348 trace:built-in:git'update -index''-z''--add''--remove''--stdin'
17:04:52.752634 git.c:348 trace:built-in:git'write-tree'
17:04:53.772245 git.c:348 trace:built-in:git'commit-tree''< hex_number>''-p''< hex_number>''-p''< hex_number>'
17:04:54.778991 git.c:348 trace:b uilt-in:git'update-ref''-m''WIP on< branch> ;:< hex_number> <分支>保留工作位''refs / stash''< hex_number>'
保存的工作目录和索引状态WIP on< branch> ;:< hex_number> <分支>保持工作一段时间
17:04:55.787801 git.c:348 trace:built-in:git'reset''--hard'
HEAD现在位于< hex_number> <分支>保持工作一点点

我主要使用Atlassian的SourceTree,但问题仍然存在于git上命令行(同样,我所显示的日志也是如此)。我们的代码托管来源是MULTIPLE,Github.com上的私人回购站。



有什么我可以尝试加快git操作?它似乎并不重要,它们都很慢。



在此先感谢。另外,如果这不是这个问题的正确答案,很抱歉。 :)

解决方案

发现问题。这是我的杀毒软件。 WebRoot把它搞砸了。我有一张支持凭单来帮助他们做什么,但现在我已经禁用了它。

Whenever I use anything Git related on my Macbook (Brand-new Macbook Pro with El Capitan), it takes almost a full minute for each command. I did a simple

GIT_TRACE=1 git stash

and got back this:

17:04:27.460826 git.c:557               trace: exec: 'git-stash'
17:04:27.463136 run-command.c:347       trace: run_command: 'git-stash'
17:04:32.503827 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:04:34.521223 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:04:35.527473 git.c:348               trace: built-in: git 'config' '--get-colorbool' 'color.interactive'
17:04:36.534443 git.c:348               trace: built-in: git 'config' '--get-color' 'color.interactive.help' 'red bold'
17:04:37.538357 git.c:348               trace: built-in: git 'config' '--get-color' '' 'reset'
17:04:38.544472 git.c:348               trace: built-in: git 'update-index' '-q' '--refresh'
17:04:39.567521 git.c:348               trace: built-in: git 'diff-index' '--quiet' '--cached' 'HEAD' '--ignore-submodules' '--'
17:04:40.578480 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:04:41.595078 git.c:348               trace: built-in: git 'update-index' '-q' '--refresh'
17:04:42.612776 git.c:348               trace: built-in: git 'diff-index' '--quiet' '--cached' 'HEAD' '--ignore-submodules' '--'
17:04:43.621067 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:04:44.636720 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:04:45.642275 git.c:348               trace: built-in: git 'rev-list' '--oneline' '-n' '1' 'HEAD' '--'
17:04:46.648038 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:04:47.653633 git.c:348               trace: built-in: git 'write-tree'
17:04:48.664282 git.c:348               trace: built-in: git 'commit-tree' '<hex_number>' '-p' '<hex_number>'
17:04:49.672125 git.c:348               trace: built-in: git 'read-tree' '--index-output=/Users/<USER>/.git/index.stash.62412' '-m' '<hex_number>'
17:04:50.707740 git.c:348               trace: built-in: git 'diff' '--name-only' '-z' 'HEAD' '--'
17:04:51.737890 git.c:348               trace: built-in: git 'update-index' '-z' '--add' '--remove' '--stdin'
17:04:52.752634 git.c:348               trace: built-in: git 'write-tree'
17:04:53.772245 git.c:348               trace: built-in: git 'commit-tree' '<hex_number>' '-p' '<hex_number>' '-p' '<hex_number>'
17:04:54.778991 git.c:348               trace: built-in: git 'update-ref' '-m' 'WIP on <branch>: <hex_number> <branch> Kept working for a bit' 'refs/stash' '<hex_number>'
Saved working directory and index state WIP on <branch>: <hex_number> <branch> Kept working for a bit
17:04:55.787801 git.c:348               trace: built-in: git 'reset' '--hard'
HEAD is now at <hex_number> <branch> Kept working for a bit

I'm primarily using Atlassian's SourceTree, but the problem also persists on the git command-line (also, so is the log I showed). Our source for hosting the code is MULTIPLE paid, private repos on Github.com.

Is there anything that I can try to speed up git operations? It doesn't seem to matter which operation it is, they are ALL slow.

Thanks in advance. Also, sorry if this isn't the right spot for this question. :)

解决方案

Found the problem. It was my antivirus. WebRoot was screwing it all up. I have a support ticket in to them for what to do, but for now I've disabled it.

这篇关于Mac / OSX上的Git速度非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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