Prune unreferenced Git LFS objects
Problem to solve
Follow up for #17711 (closed).
It is now possible for sysadmins to recover storage space used by LFS objects that are no longer referenced in a Git repo https://docs.gitlab.com/ee/raketasks/cleanup.html#remove-unreferenced-lfs-files-from-filesystem. It must be run per project. This is a bare minimum, but it took quite some work to get here.
Of course it would be ideal to not have to worry about this at all by automatically running it on all projects every X amount of time.
But there are real concerns that this process may be too slow and wasteful to run constantly within GitLab. We can now validate this concern with the rake task.
Proposal
- Users are able to clean-up LFS objects by running housekeeping after force push (thanks to !38813 (merged))
- Housekeeping can be run either via GUI (
Project > Settings > Advanced > Housekeeping
) or API (POST /projects/:id/housekeeping)
- Housekeeping can be run either via GUI (
- Users are able to clean-up repo files and LFS objects simultaneously by running repo cleanup after force push
- Self-managed users can also run the
gitlab-rake
cleanup tasksudo gitlab-rake gitlab:cleanup:orphan_lfs_file_references PROJECT_PATH="namespace/project" DRY_RUN=false
- Documentation will be updated to reflect this as part of #238605 (closed)
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.