I use git-lfs to track large files, the setup is:
.
├── ...
├── ...
├── large-files
├── ...
├── ...
└── .git
where an external storage is mounted on large-files
, and all large files go here.
The problem with this setup is, there is a .git/lfs
directory, which uses the same amount disk spaces as the large-files
, since I will never delete from large-files
, and my SSD, where the working tree resides, has smaller capacity than the external storage, .git/lfs
will outgrow my SSD's capacity.
Is there a way to reduce the size of this .git/lfs
without moving it to an external storage? (putting .git
or the entire working tree to the external storage is not an option, because the external storage is not always available)
Git LFS does not compress files. Some files are compressible, and some are not. It, like Git's partial clone feature, is designed to offload most of the data to a trusted server for the purposes of making local access lighter and cheaper.
remove the file from your project's current file-tree. remove the file from repository history — rewriting Git history, deleting the file from all commits containing it. remove all reflog history that refers to the old commit history. repack the repository, garbage-collecting the now-unused data using git gc.
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. Use the Git Large File Storage (LFS) extension with an existing Bitbucket Cloud repository.
DESCRIPTION. Deletes local copies of LFS files which are old, thus freeing up disk space. Prune operates by enumerating all the locally stored objects, and then deleting any which are not referenced by at least ONE of the following: ○ the current checkout.
.git/lfs
is the local cache directory for git-lfs, Git Large File Storage. It keeps the repository size down by storing the history of large files in cloud storage instead of in local history.
.git/lfs
will not grow indefinitely. It's normal for git-lfs
to cache "recent" versions of large files there. You can run git lfs prune
to have it prune the cache, and you can configure how much it prunes with lfs.pruneoffsetdays
and lfs.fetchrecent
.
You can also put this directory elsewhere by changing lfs.storage
.
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