开发者

How do you reclaim disk space after adding an alternate in git?

I have a git working directory and have added to .git/objects/info/alternates so that this working directory does not need to store duplicate data that's already in another working directory on my machine. (This is what gi开发者_运维问答t clone --reference=DIRECTORY does). However, duplicate objects already stored in the working directory aren't deleted from my .git/ directory. This means the .git/ directory stays large.

How do I get rid of the duplicate objects so the .git/ directory is smaller?


git repack -adl

The -l option in particular omits objects that are borrowed from an alternate. See git help repack and git help pack-objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜