Search code examples
gitgithubgit-lfs

Delete git LFS files not in repo


I uploaded some files to git LFS and I went over my storage limit. Now, the files I uploaded don't show up in the repo, but I'm still over my data limit and I can't upload anything.


Solution

  • Currently that is not possible via lfs command line. From the Atlassian Git LFS tutorial:

    The Git LFS command-line client doesn't support pruning files from the server, so how you delete them depends on your hosting provider. In Bitbucket Cloud, you can view and delete Git LFS files via Repository Settings > Git LFS

    GitHub even suggest recreating the repo:

    To remove Git LFS objects from a repository, delete and recreate the repository. When you delete a repository, any associated issues, stars, and forks are also deleted.

    But it is still good idea to use tools like BFG to clear out large files in history before moving around.