github - How do I get rid of a big pack file in my git repo? -


i have git repo 1 branch, coworker pushed big files on. after remove big files, repo ~200mb, git folder still 1.3gb because of huge .git/pack folder.

what tried far (based on other answers so, not seem me):

  • the bfg tool -> got rid of big files, pack folder still 1.3gb
  • git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch big_files' --prune-empty -> rewrote history, big files not mentioned in historical commits anymore on github website
  • git repack -a -d -f --depth=250 --window=250 -> not make pack smaller
  • git reflog expire --expire=now --all && git gc --prune=now --aggressive -> alternative git repack, not work better
  • git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin -> no avail
  • the git clone file:// trick locally clone repo, , should remove spurious refs -> still, pack 1.3gb

what next step?

the easiest way download branch remove don't want , make repository. otherwise if have access github can go , manage file there. best solution in opinion download , make clean new branch without chance of having cached file or anything.


Comments