Adventures in Git LFS (Large File Storage)
Git LFS, or Large File Storage, is a method for storing files that don’t change often (e.g, images and videos), outside of the git repo.
Usually this isn’t a concern for most projects as Bit Bucket supports 1GB repos (…really up to 2GB with an annoying warning.)
However, if you find yourself branching a lot on project, it’s probably worth using LFS.
Setting it up is easy. First install it by downloading it, or using homebrew or macports as described here.
Then you just specify which files you want it to track. In this example, I’m telling it to put all files in the media folder into LFS:
git lfs track media/*
It works well…with a few huge caveats that make me *not recommend* this unless you find yourself hitting the git repo limit.
- Adding Git LFS after-the-fact to a standard repo is a PITA. It’s best to avoid doing this, and just start out by using Git LFS from the get-go.
- However, Git LFS and Dandelion deploy do *not* get along. Anything that is in LFS will not be uploaded properly with Dandelion. Therefore, you should also exclude the same folders that you’re tracking in LFS in the Dandelion file, and simply upload those images manually with FTP.
- HOWEVER (not tested), migrating the images with WP-DB Pro *should* work, so…there’s that.
About north street
We engineer the thoughtful transformation of great organizations. Our proven process helps us understand what your competitors are doing right — and wrong. Want to learn more? Let’s chat.