7

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.

2 Answers2

5

Deleting local Git LFS files You can delete files from your local Git LFS cache with the git lfs prune command:

$ git lfs prune

✔ 4 local objects, 33 retained

Pruning 4 files, (2.1 MB)

✔ Deleted 4 files

This will delete any local Git LFS files that are considered old. An old file is any file not referenced by:

  • the currently checked out commit
  • a commit that has not yet been pushed (to origin, or whatever lfs.pruneremotetocheck is set to)
  • a recent commit

for details please go through this link https://www.atlassian.com/git/tutorials/git-lfs

Rohit Poudel
  • 1,793
  • 2
  • 20
  • 24
3

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.

hurturk
  • 5,214
  • 24
  • 41
  • Thank you, I was planning on deleting the repo anyways since I did a lot of messy commits. After I deleted it all my git LFS data came back – awesomeness872 Jun 12 '17 at 04:20