【问题标题】:git branch switch takes half a minute?git 分支切换需要半分钟?
【发布时间】:2015-01-09 22:46:37
【问题描述】:

从工作中得到了一台更强大、更新鲜的机器,开始安装开发工具,这简直是一场噩梦,我从来没有在旧机器上遇到过 git 性能问题。在这里,这是没有道理的:

ons-mbp:spec ALE$ time git checkout fsfs

Switched to branch 'fsfs'

real    0m30.080s
user    0m0.007s
sys 0m0.006s

    ons-mbp:spec ALE$ time git checkout master

Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

real    0m30.083s
user    0m0.007s
sys 0m0.007s

尝试重新安装不同的 git 版本,通过自制软件和手动尝试 - 零效果。

谁能给个提示?

操作系统版本:10.9.5

【问题讨论】:

  • git is very very slow 的可能重复项
  • 可能不是你的错。如果 repo 有存储大型二进制文件的习惯,那么您必须在某个时候处理它或付出性能成本。
  • 找到了问题(谷歌深度清除 - 不是重复的,将立即发布)

标签: macos git performance


【解决方案1】:

在进行全新安装时,完全忘记了设置全局用户详细信息。

 git config --global user.name "Test Test"
 git config --global user.email "testgmail.com"

归功于:

"I normally do this right away when setting up my account on a new machine. The fresh install didn't trigger that reflex. I'm surprised that this is needed to keep git from preforming silly DNS lookups but no big deal."

ons-mbp:spec ALE$ time git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

real    0m0.012s
user    0m0.006s
sys 0m0.005s
ons-mbp:spec ALE$ time git checkout fsfs
Switched to branch 'fsfs'

real    0m0.012s
user    0m0.006s
sys 0m0.005s

免于心脏病发作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 2010-09-06
    • 2021-12-25
    相关资源
    最近更新 更多