I have a git repository with git-lfs installed and I would like to have all PDF files above some size in LFS, but not all PDF files, as git-lfs supports. The reason for this is that I have many tiny PDF figure files in vector format which are ok to have in regular version control, and a few large PDFs.
Is it possible to configure git-lfs this way?
I use git from Atlassian source-tree and host the repository in bitbucket, maybe those support this more advanced use-case?
There is currently a 10 GB size limit for the file upload into the media storage. Uploading files larger than 10 GB will result in an error. Use the Git LFS extension with a repository to speed up the handling of large files.
Git LFS (Large File Storage) is a Git extension developed by Atlassian, GitHub, and a few other open source contributors, that reduces the impact of large files in your repository by downloading the relevant versions of them lazily.
Unfortunately, this is not possible on git-lfs. See issue #282.
There is however a hack provided by user Baccanno, but I wouldn't recommend it for repositories with many files. It tracks all files above a threshold, but it could be modified to do it for PDF's only.
(Copied here without warranty)
Put this in the [alias]
section of your git config (project_root/.git/config
) and change the 300k at the end to the size you wish
track-large = !"git st --porcelain --ignore-submodules | grep -v \"D \" | awk '{ l=length($0); s=substr($0,4,l-1); print s}' | sed -n 's/\\(\\(.* -> *\\)\\|\\)\\(.*\\)/\\3/p' | xargs -I{} find {} -size +300k | xargs -I{} git lfs track \"{}\""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With