How to shrink the .git folder

后端 未结 7 2352
花落未央
花落未央 2020-12-02 04:16

My current base has a total size of approx. 200MB.

But my .git folder has an amazing size of 5GB (!). Since I push my work to an external server, i don\'t need any b

7条回答
  •  生来不讨喜
    2020-12-02 04:38

    you should not delete all changes older than 30 days (i think it's somehow possible exploiting git, but really not recommended).

    you can call git gc --aggressive --prune, which will perform garbage collection in your repository and prune old objects. do you have a lot of binary files (archives, images, executables) which change often? those usually lead to huge .git folders (remember, git stores snapshots for each revision and binary files compress badly)

提交回复
热议问题