|||

Remove Large Files from Git History

I recently had the case of a client uploading huge tiff files (some larger than 100 MB) into Statamic image fields. Obviously, I should make this impossible in the first place.

Yet, here I was with these big files having been uploaded and auto-committed by Statamic’s Git integration. While committing these files worked, they couldn’t be pushed to the remote repository due to Github’s file size limits. The client had already replaced the problematic files in the backend, so the only issue was that they were still present in Git’s history, clogging up pushes and pulls.

That’s when I stumbled across git filter-repo and learned about a wonderful option called --strip-blobs-bigger-than, which does exactly what it sounds like: it removes files bigger than the threshold passed in from the repository and rewrites Git history to make it disappear completely. Needless to say, having a backup in place is a good idea when messing around with such tools.

Here’s what I did to remove all those oversized images from the project: git filter-repo --strip-blobs-bigger-than 50M

Up next My PKM App Stack for 2023 Render first heading inside Statamic Page Builder as `h1` Say you have a headline field on various Page Builder elements, and one as a set of in a Bard field. Both should visually look the same.
Latest posts Pros and Cons of Reflect Notes App A Love Letter to Sublime Internet Lazy.so is an amazing tool. Here's why I don't keep it Look Around You Don’t ask what the world needs Carl Sagan has shown the absurdity of not acting against climate change back in 1990 On the plus sides of being a web designer Friday Deployment A success message that communicates the opposite of success Do not demand to be appreciated Craft Docs vs Bear Notes Figma AI Rant Epomaker TH80 Pro Polyamor, aber mit PKM apps 🫣 Ironie, die Fabi Rommel Helft der Natur Stimmen im Kopf - Flohmarkt croox website online Tiny Garden Paradise Oktober in Europa Figma Rant: forever assembling iCloud Drive Rant Schwiegerfuchs Same Vibe Tailwind and Web Craftsmanship Buttons with CSS Expand Basic Markdown Formatting in Apple Notes Cannot Divide by Zero in Peak Picture Partial Applying a Growth Mindset (Doodle) When Gmail Messages deleted in Apple Mail keep coming back