git : How to remove a big file wrongly committed


Notice: Undefined index: sfsi_original_counts in /home/thomascojx/www/blog/wp-content/plugins/ultimate-social-media-icons/libs/controllers/sfsiocns_OnPosts.php on line 45

I added a large file to a git repository (102Mb), commited and push and got an error due to size limit limitations on github

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 7d51855d4f834a90c5a5a526e93d2668
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File coverage/sensitivity/simulated.bed is 102.00 MB; this exceeds GitHub's file size limit of 100.00 MB

Here, you see the path of the file (coverage/sensitivity/simualted.bed).

So, the solution is actually quite simple (when you know it): you can use the filter-branch command as follows:

git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
git push
Please follow and like us:
This entry was posted in Computer Science and tagged , . Bookmark the permalink.

9 Responses to git : How to remove a big file wrongly committed

  1. Drdrej says:

    thank you!

  2. Nikiya Simpson says:

    You don’t know how much I appreciate this! I’m glad I found you on google.

  3. Anonymous says:

    That did it, thanks so much!

  4. Filipe Fenrich says:

    Thank u very much!!

  5. milad khanmohammadi says:

    so many thanks, you fixed my problem.
    i really appreciate you

  6. Ravi says:

    Appreciate the solution…

  7. Samuel James says:

    Thanks for this!

  8. Tony Nguyen says:

    Thank you very much

  9. Borat says:

    as Borat would say “Woa woaaa weee waaaa. I like! High five!”

Leave a Reply

Your email address will not be published.