version control - How to remove/delete a large file from commit history in Git repository? -
occasionally dropped dvd-rip website project, carelessly git commit -a -m ...
, and, zap, repo bloated 2.2 gigs. next time made edits, deleted video file, , committed everything, compressed file still there in repository, in history.
i know can start branches commits , rebase 1 branch onto another. should merge 2 commits big file didn't show in history , cleaned in garbage collection procedure?
use bfg repo-cleaner, simpler, faster alternative git-filter-branch
designed removing unwanted files git history.
carefully follow usage instructions, core part this:
$ java -jar bfg.jar --strip-blobs-bigger-than 100m my-repo.git
any files on 100mb in size (that aren't in latest commit) removed git repository's history. can use git gc
clean away dead data:
$ git gc --prune=now --aggressive
the bfg typically @ least 10-50x faster running git-filter-branch
, , easier use.
full disclosure: i'm author of bfg repo-cleaner.
Comments
Post a Comment