简体   繁体   中英

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM