Git repo still huge after large files removed from repository history

前端 未结 4 480
后悔当初
后悔当初 2021-01-12 19:21

I have a codebase that (until now) used git to store its dependencies. The repository itself is available here (warning: it\'s HUGE). Needless to say, I need to remove the d

4条回答
  •  花落未央
    2021-01-12 19:42

    I had accidentally stored large .jpa backups of my site in git -

    git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch MY_BIG_DIRECTORY_OR_FILE' --tag-name-filter cat -- --all

    Relpace MY_BIG_DIRECTORY_OR_FILE with the folder in question to completely rewrite your history, including tags.

    source:

    http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history

提交回复
热议问题