Why is my .git file huge?

我怕爱的太早我们不能终老 提交于 2019-12-03 15:42:05
William Seiti Mizuta

Your .git folder is really big because the PSDs files are still present in the repository. To remove them, you need to modify the history using git filter-branch. Here explains how to use this command. After, you will need to clean the repository.

I created a script to help this job. If you want to use it, you can download it from github. Any comments are welcome.

You want to use the BFG Repo-Cleaner, a faster, simpler alternative to git-filter-branch designed for removing large files from Git repos.

Download the BFG jar (requires Java 6 or above) and run this command:

$ java -jar bfg.jar  --strip-blobs-bigger-than 10MB  my-repo.git

Any files over 10MB in size (that aren't in your latest commit) will be removed from your Git repository's history. You can then use git gc to clean away the dead data:

$ git gc --prune=now --aggressive

The BFG is typically 10-50x faster than running git-filter-branch and the options are tailored around these two common use-cases:

  • Removing Crazy Big Files
  • Removing Passwords, Credentials & other Private data

Full disclosure: I'm the author of the BFG Repo-Cleaner.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!