Git Gui:永远得到“这个存储库目前有大约 320 个松散对象。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21457407/
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
Git Gui: Perpetually getting "This repository currently has approximately 320 loose objects."
提问by sashoalm
Every time I start Git Gui on a particular project I get this message:
每次我在特定项目上启动 Git Gui 时,我都会收到以下消息:
This repository currently has approximately 320 loose objects.
该存储库目前有大约 320 个松散对象。
I then proceed to click Yes, and I get this dialog:
然后我继续点击Yes,我得到这个对话框:
The thing is, when I open Git Gui again, I get the exact same message, again about 320 loose objects! It's as if clicking Yeshad no effect at all.
问题是,当我再次打开 Git Gui 时,我得到了完全相同的消息,再次大约有 320 个松散的对象!就好像单击Yes根本没有任何效果。
采纳答案by Greg Burghardt
Just simply skipping the pop up, as How to skip "Loose Object" popup when running 'git gui'suggests in the accepted answer is overlooking the fact that Git is communicating a possible performance issue to you. This should be fixable by running this command from the command line:
只是简单地跳过弹出窗口,正如在接受的答案中建议的如何在运行“git gui”时跳过“松散对象”弹出窗口忽略了 Git 正在向您传达可能的性能问题这一事实。这应该可以通过从命令行运行此命令来解决:
cd path/to/your/git/repo
git gc --aggressive
From the output of git help gc
:
从输出git help gc
:
Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and removing unreachable objects which may have been created from prior invocations of git add.
Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.
--aggressive
Usually git gc runs very quickly while providing good disk space utilization and performance. This option will cause git gc to more aggressively optimize the repository at the expense of taking much more time. The effects of this optimization are persistent, so this option only needs to be used occasionally; every few hundred changesets or so.
在当前存储库中运行许多内务管理任务,例如压缩文件修订版(以减少磁盘空间并提高性能)和删除可能已从先前的 git add 调用中创建的无法访问的对象。
鼓励用户在每个存储库中定期运行此任务,以保持良好的磁盘空间利用率和良好的操作性能。
- 挑衅的
通常 git gc 运行速度非常快,同时提供良好的磁盘空间利用率和性能。此选项将导致 git gc 以花费更多时间为代价更积极地优化存储库。这个优化的效果是持久的,所以这个选项只需要偶尔使用;每几百个变更集左右。
This should keep the prompt from popping up for a while.
这应该可以防止提示弹出一段时间。
回答by AdvenC
I use command:
我使用命令:
git gc --prune=now
git gc --prune=now
and no more too many loose object warning after done.
完成后不再有太多松散物体警告。
source of reference: https://git-scm.com/docs/git-gc