git SourceTree 非常慢,有很多存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28105472/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SourceTree very slow with many repositories
提问by Dimitri Dewaele
I work on a lot of small projects on daily basis and need to switch often.
我每天都在做很多小项目,需要经常切换。
- I have over 50 Git Repositories in Sourcetree.
- Usually 5 projects are open in "Tabs".
- 我在 Sourcetree 中有 50 多个 Git 存储库。
- 通常在“选项卡”中打开 5 个项目。
Switching from "Tab" in SourceTree is very slow. Sometimes up to 15 seconds. How can I improve this behaviour?
从 SourceTree 中的“Tab”切换非常慢。有时长达 15 秒。我怎样才能改善这种行为?
回答by Peet Brits
I know this is an old question, but you could also try this:
我知道这是一个老问题,但你也可以试试这个:
https://stackoverflow.com/a/24045966/371917
https://stackoverflow.com/a/24045966/371917
$ git config --global core.preloadindex true
$ git config --global core.fscache true
$ git config --global gc.auto 256
Secondly, here is a post that explains that git gc --aggressive
may not be a great idea.
其次,这里有一篇文章解释了这git gc --aggressive
可能不是一个好主意。
回答by Bas Slagter
Executing the stated git command did not do the trick for me. Eventually what really speed up SourceTree was disabling 'spell check commit messages'in the tools > options menu. I also disabled 'load avatar images from gravatar.com' option while I was at it.
执行指定的 git 命令对我没有帮助。最终,真正加速 SourceTree 的是在工具 > 选项菜单中禁用“拼写检查提交消息”。我还禁用了“从 gravatar.com 加载头像图像”选项。
回答by Emir Lima
Any action in my source tree was super slow. Commit, click on a file to see changes, push etc.
我的源代码树中的任何操作都非常慢。提交,单击文件以查看更改,推送等。
I discovered that my antivirus (avast) was the cause. I disabled the file protection and source tree became immediate.
我发现我的防病毒软件 (avast) 是原因。我禁用了文件保护,源代码树立即生效。
回答by Emir Lima
I had this problem too. I also have avast and this worked for me and might work for you and maybe a different AV. But I added the C:\Users\YOURNAME\AppData\Local\Atlassian\ to my avast exclusions directory and now it is running much faster!
我也有这个问题。我也有 avast,这对我有用,可能对你有用,也许对不同的 AV 有用。但是我将 C:\Users\YOURNAME\AppData\Local\Atlassian\ 添加到我的 avast 排除目录中,现在它运行得更快了!
回答by Sergey Gussak
For me it was the 'spell check commit messages' option in the settings. Even clicking the tick took 20 sec to process, but it was the last freezing I experienced.
对我来说,这是设置中的“拼写检查提交消息”选项。即使单击滴答声也需要 20 秒来处理,但这是我经历的最后一次冻结。
回答by CodeWizard
The source tree ticket system has a ticket about a similar bug that was fixed. http://www.lifehacker.com.au/2015/01/6-month-old-critical-performance-bug-with-sourcetree-is-getting-attention/
源树票证系统有一个关于已修复的类似错误的票证。 http://www.lifehacker.com.au/2015/01/6-month-old-critical-performance-bug-with-sourcetree-is-getting-attention/
I never used so many repos at once and assume that sourcetree is not build to handle this amount of data on every time you switch tabs. I assume sourcetree need to refresh the data and reads and build your data out of the disk page file.
我从来没有一次使用过这么多的存储库,并假设每次切换选项卡时都没有构建 sourcetree 来处理如此大量的数据。我假设 sourcetree 需要刷新数据并从磁盘页面文件中读取和构建数据。
Try to use fewer projects and see it you still have the same problem.
尝试使用更少的项目,看看你仍然有同样的问题。
If you still experience lack of performance try to run gc (garbage collector) on your repos and test it again.
如果您仍然遇到性能不足的情况,请尝试在您的存储库上运行 gc(垃圾收集器)并再次测试。
git gc --aggressive
shrinks the repository size.
git gc --aggressive
缩小存储库大小。
回答by Jignesh Variya
Improved performance with
提高性能
- Install latest git exe from https://git-scm.com/download/win
- Configured Options > Git >
Use System Git
insteadUse Embedded Git
- 从https://git-scm.com/download/win安装最新的 git exe
- 配置选项 > Git >
Use System Git
代替Use Embedded Git
回答by Fabiano Araujo
This may help someone else. I was having slow response issues with SourceTree 1.6.x and git 1.9.x. Downgrading git to 1.8.3 and SourceTree to 1.5.2 solved the problem.
这可能会帮助其他人。我在 SourceTree 1.6.x 和 git 1.9.x 上遇到了响应缓慢的问题。将 git 降级到 1.8.3 并将 SourceTree 降级到 1.5.2 解决了这个问题。
回答by brkeyal
Move the git folder to an SSD drive, if possible (dramatically improved my SourceTree performance).
Avoid having a lot of stashes, which REALLY slows down SourceTree.
如果可能,将 git 文件夹移动到 SSD 驱动器(显着提高了我的 SourceTree 性能)。
避免有很多隐藏,这真的减慢了 SourceTree。
回答by Vik
Latest version currently 2.1.2.5 released June 2017 was running dog slow for me even after trying all the answers here prior to today (even with just 1 project).
目前 2017 年 6 月发布的最新版本 2.1.2.5 对我来说即使在今天之前尝试了所有答案(即使只有 1 个项目),对我来说也很慢。
Apparently, .gitconfig was written to a network drive (H:) when SourceTree was first installed. This is what got the performance to instantaneous for me:
显然,.gitconfig 是在首次安装 SourceTree 时写入网络驱动器 (H:)。这就是让我瞬间获得性能的原因:
Move .gitconfig to local SSD (C:)
Set HOME variable. In Environment Variables (specifically User variable), set HOME to the value of C: (or whatever other path you decide to set).
将 .gitconfig 移动到本地 SSD (C:)
设置 HOME 变量。在环境变量(特别是用户变量)中,将 HOME 设置为 C: 的值(或您决定设置的任何其他路径)。