git rewrite history - Shrinking Git Repo - Object in packet, not in commits -
i'm trying shrink git repo that's around 2gb.
i'm following "removing objects" section of chapter 9 (9.7) in progit book: http://git-scm.com/book/en/git-internals-maintenance-and-data-recovery
after running git gc
, git verify-pack
, git rev-list
command, i've found .tar
file that's 118mb. don't need in repo @ all. needs destroying forever.
but when try find out commits have used file, nothing:
git log --oneline -- news/news.tar
does mean file not in repository history? , if that's case can leave or still pushed object when git push
?
if that's case, how rid of it.
use bfg, not git-filter-branch...
the bfg gives foolproof method of getting rid of large files, easier using git filter-branch
, see http://rtyley.github.io/bfg-repo-cleaner/ :
$ bfg --strip-blobs-bigger-than 100m my-repo.git
...still here?
if you'd try figure out what's gone awry when following steps "removing objects" in section 9.7 of progit book, there unfortunately several places it's possible go wrong.
the news.tar
file kept 1 of branches, tags or other kind of ref - know because file showed when ran git rev-list --objects --all
(the '--all' param means @ all refs, beyond branches - tags, , other exotic types of ref) ...but git log --oneline -- news/news.tar
command not have --all
, it's listing current branch. blob being held different reference- different branch or tag.
seriously, use bfg.
full disclosure: i'm author of bfg repo-cleaner.
Comments
Post a Comment