1

I'm trying to entirely remove some very large files from my git repo history. I've tried almost every solution I've ever seen offered, but I can never make the large file objects "unreachable" so that they will be garbage collected. Here's a rundown of what I've tried:

    # finding the largest file
$ git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -n | tail -1
3d975c0908cde6010cbfcd0424eaf74c9dcf9f13 blob   1314240900 19175430 50462430

    # which file?
$ git rev-list --objects --all | grep  3d975c09
3d975c0908cde6010cbfcd0424eaf74c9dcf9f13 rawdata/brownfields/GEODATA_Featureclass_MAR2013.dbf

$ git filter-branch -f --tree-filter 'git rm -fr --cached --ignore-unmatch rawdata'
$ git reflog expire --expire=now --verbose --all
$ git gc --aggressive --prune=now
$ git prune --expire now

$ git rev-list --objects --all | grep  3d975c09
3d975c0908cde6010cbfcd0424eaf74c9dcf9f13 rawdata/brownfields/GEODATA_Featureclass_MAR2013.dbf

I'm fairly confident that this file has been wiped clean from the history except for this pesky reference in the rev-list, which is what's not allowing it to be garbage-collected.

Is it true that this object will never be deleted if it shows up in the rev-list? If so, how can I remove its reference from the rev-list? I've tried so many commands, in so many different permutations, to no avail. Any insight would be much appreciated.

maackle
  • 2,074
  • 2
  • 15
  • 27
  • 1
    With `rev-list` you are looking at all branches but you have run `filter-branch` only on the current branch. Have you determined which other branches this file is on? – CB Bailey Jun 27 '13 at 08:06
  • 1
    What about remote branches and tags? `git branch -r` and `git rag` ? – CB Bailey Jun 27 '13 at 08:21
  • Ah ha! It was a tag. [This answer](http://stackoverflow.com/questions/7672907/why-has-git-filter-branch-not-rewritten-tags) solved it – maackle Jun 28 '13 at 20:29

1 Answers1

0

It turns out I had an old tag still referencing the large files, and wasn't aware that filter-branch does not operate on tags. This answer led me in the right direction.

In short, I needed to add the --tag-name-filter [tag] option to filter-branch

Community
  • 1
  • 1
maackle
  • 2,074
  • 2
  • 15
  • 27