Skip to content

Instantly share code, notes, and snippets.

@haijerome
Created March 11, 2014 03:31
Show Gist options
  • Save haijerome/9478989 to your computer and use it in GitHub Desktop.
Save haijerome/9478989 to your computer and use it in GitHub Desktop.
Git Remove files from Git history and remove large git files - SO thread -http://stackoverflow.com/questions/22227851/error-while-pushing-to-github-repo/22228417
somename@somedomain.com [~/public_html/dev]# java -jar bfg.jar --strip-blobs-bigger-than 50M
Using repo : /home/somename/public_html/dev/.git
Scanning packfile for large blobs: 23742
Scanning packfile for large blobs completed in 646 ms.
Found 2 blob ids for large blobs - biggest=105755937 smallest=60624703
Total size (unpacked)=166380640
Found 16224 objects to protect
Found 3 commit-pointing refs : HEAD, refs/heads/master, refs/remotes/origin/master
Protected commits
-----------------
These are your protected commits, and so their contents will NOT be altered:
* commit 071990c3 (protected by 'HEAD')
Cleaning
--------
Found 11 commits
Cleaning commits: 100% (11/11)
Cleaning commits completed in 231 ms.
Updating 1 Ref
--------------
Ref Before After
---------------------------------------
refs/heads/master | 071990c3 | 54d1fe49
Updating references: 100% (1/1)
...Ref update completed in 58 ms.
Commit Tree-Dirt History
------------------------
Earliest Latest
| |
. . . . .D m m m m m
D = dirty commits (file tree fixed)
m = modified commits (commit message or parents changed)
. = clean commits (no changes to file tree)
Before After
-------------------------------------------
First modified commit | e8142add | 21a5f8bd
Last dirty commit | e8142add | 21a5f8bd
In total, 10 object ids were changed - a record of these will be written to:
/home/somename/public_html/dev.bfg-report/2014-03-10T10-56/object-id-map.old-new.txt
BFG run is complete!
someuser@somedomain [~/public_html/dev]# git gc --aggressive --prune=now
Counting objects: 23754, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20825/20825), done.
Writing objects: 100% (23754/23754), done.
Total 23754 (delta 9425), reused 0 (delta 0)
someuser@somedomain [~/public_html/dev]# git push -f
Counting objects: 1341, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (343/343), done.
Writing objects: 100% (1330/1330), 3.40 MiB, done.
Total 1330 (delta 799), reused 1327 (delta 798)
To git@github.com:someuser/some-repo.git
a174eb9..54d1fe4 master -> master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment