git: can't find blob - want to get rid of it from pack

前端 未结 5 454
广开言路
广开言路 2021-01-02 01:32

I\'ve a large blob that I want to get rid of! I thought I removed the file using this solution: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/ (I

5条回答
  •  温柔的废话
    2021-01-02 01:54

    You can use git repack -Ad to force git to reconstruct your packs, and to unpack any unreachable objects into loose objects. At this point you can use git gc --prune=now to discard the unreachable objects.

    You should also double-check that you actually expired your reflogs. I believe git reflog expire --all will default to 90 days (or 30 for unreachable objects), so you may want to use git reflog expire --expire-unreachable=now --all instead (this needs to be done before the repack+gc).

提交回复
热议问题