【发布时间】:2011-09-12 18:22:51
【问题描述】:
今天,git 开始变得有趣(嗯,比平时更有趣),坚持在每次合并后运行 git gc,即使它们是背靠背的。
C:\Projects\my-current-project>git pull
remote: Counting objects: 31, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 16 (delta 11), reused 0 (delta 0)
Unpacking objects: 100% (16/16), done.
From git.company.com:git/
e992ce8..6376211 mybranch/next -> origin/mybranch/next
Merge made by recursive.
Auto packing the repository for optimum performance. You may also run "git gc" manually. See "git help gc" for more information.
FIND: Parameter format not correct
Counting objects: 252732, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (59791/59791), done.
Writing objects: 100% (252732/252732), done.
Total 252732 (delta 190251), reused 252678 (delta 190222)
Removing duplicate objects: 100% (256/256), done.
.../stylesheets/style.css | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
这是令人难以置信的破坏性,我担心这意味着我的存储库以某种方式损坏(这是我第一次自动看到它gc)。我的担心是没有根据的吗?如果我的仓库没问题,如何让自动打包停止?!
【问题讨论】:
-
确实会发生自动 gc,但通常很少发生。
-
@asmeurer 问题是每次操作都会发生这种情况...
-
我知道。但是您似乎对自动
gc会发生感到惊讶,所以我只想指出它确实会发生。 -
@asmeurer 当时我是一个 git 新手。我的假设是它运行一次 GC,然后它就完成了,不必再做任何事情了。现在我知道得更清楚了(例如,git 在一个稍微不同的自洽现实模型上运行;)
-
也许我没有正确地传达我的自我。我的垃圾人每周都来我的街上,我每次扔东西他都不会来。同样,GC 应该定期发生,而不是每次我运行 git 命令时。后者正在发生,我很困惑,现在如果发生了,我只会叹息说“哦,混蛋,你太疯狂了。”
标签: git