Shit! I accidentally commited large files to my repo

So I realized that a git repo I've been using at work had some older commits
with unnecessary LARGE files.  The large files were things like executable binaries & application logs that weren't properly ignored in the .gitignore file.  Committing & leaving the unintentionally committed files in git repos can impact stability & performance if left unchecked.

Image from Ilmari Kontulainen's blog















Unintentionally committing unnecessary & large files is a very common
mistake that most new & veteran git users make & don't realize until a few commits down the road.  I published some scripts & git commands that will help you list & remove unintentionally committed files from the git repos after the fact.  These scripts will be helpful for when you don't realize that you polluted or if you inherit an already polluted repo.



Use this gist - python script to list files in the .git repo by setting a file size "greater than" threshold. The run the git command to actually remove the files from the git repo

The script is pretty much straight forward but hit me up if you need a hand

-a


Leave a Reply

yep don't use it unless you ask ;-). Powered by Blogger.