Do I ever need to run git gc on a bare repo?

前端 未结 5 1414
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 00:40

man git-gc doesn\'t have an obvious answer in it, and I haven\'t had any luck with Google either (although I might have just been using the wrong search terms).

I un

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 01:26

    Some operations run git gc --auto automatically, so there should never be the need to run git gc, git should take care of this by itself.

    Contrary to what bwawok said, there actually is (or might be) a difference between your local repo and that bare one: What operations you do with it. For example dangling objects can be created by rebasing, but it may be possible that you never rebase the bare repo, so maybe you don't ever need to remove them (because there are never any). And thus you may not need to use git gc that often. But then again, like I said, git should take care of this automatically.

提交回复
热议问题