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

前端 未结 5 1398
没有蜡笔的小新
没有蜡笔的小新 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条回答
  •  -上瘾入骨i
    2020-12-03 01:37

    I do not know 100% about the logic of gc.. but to reason this out:

    git gc removed extra history junk, compresses extra history, etc. It does nothing with your local copies of files.

    The only difference between a bare and normal repo is if you have local copies of files.

    So, I think it stands to reason that YES, you should run git gc on a bare repo.

    I have never personally ran it, but my repo is pretty small and is still fast.

提交回复
热议问题