Company
Date Published
Author
Travis Foster
Word count
773
Language
English
Hacker News points
None

Summary

Git LFS is a Git extension designed to handle large binary files by storing them on an external file server, like JFrog Artifactory, to prevent Git repositories from becoming sluggish due to size inflation. However, storing large files in Artifactory can still lead to storage issues, as each file version is saved in its entirety. To address this, JFrog CLI provides the git-lfs-clean command, which allows for efficient cleanup of outdated or unnecessary binary files from Artifactory Git LFS repositories, thereby freeing up disk space. This command ensures that only the most recent binaries across all branches are retained, with customizable options to specify which files should be preserved or deleted. It is crucial to update all branches before executing the cleanup to avoid accidental deletion of newer files, and users can opt for a dry-run to verify which files will be removed without making any changes.