Search Unity

PSA: If you use Git LFS, make sure to set LFS filters for both uppercase and lowercase extensions

Discussion in 'General Discussion' started by Zeitcatcher, Aug 5, 2019.

Thread Status:
Not open for further replies.
  1. Zeitcatcher

    Zeitcatcher

    Joined:
    Dec 11, 2012
    Posts:
    21
    After using Git LFS for more than a year, I've recently found out that several hundred of our .PNG files still weren't tracked by LFS despite clearly having *.png filter in .gitattributes.

    As it turns out, filters in .gitattributes are case-sensitive, which is a bit of surprise since none of the templates or publicly available references (that I could find) seem to account for that.

    For bigger projects this can become a problem: as more assets with uppercase extensions get added directly to Git repository instead of LFS, the repository size could cross the critical mark of 100 MB (recommended maximum size for Git repos).

    I've assembled a custom .gitattributes file that sets case-insensitive LFS filtering of most relevant binary files, and I advise to compare it with the .gitattributes in your projects to make sure that you've got all necessary extensions covered (including both upper and lower case variants).

    https://gist.github.com/inikitin/7dff06ef9b776b2d9ab92983f525c256
     
Thread Status:
Not open for further replies.