2

I got an email from GitHub telling me that I'm nearing my quota for Git LFS, which is 1 GB. However, when using git lfs ls-files, it shows only 3 files for a total of about 100 MB. At some point in the past I remember adding an ~800 MB file to Git LFS, before deleting it, but it seems that's still counting against me.

The file would have an ".spp" extension on it, but it doesn't show up in ls-files. At this point I'm just trying to find the ID of the file so I can hopefully delete it from history, but I can't even find the file.

Is there some way to go through git lfs history to find all files ever added, even if they're no longer there?

Thanks.

Dan
  • 1,125
  • 1
  • 13
  • 22

1 Answers1

2

Finding large commits is covered in the answers to git find fat commit. And you can use the BFG Repo Cleaner is to remove the large files in your history. But there's a better solution.

Instead, you should convert your large file history to git-lfs. git lfs migrate supplies the tools. They're all oriented on certain file extensions.

For example, run git lfs migrate info to find sets of large files. For example...

$ git lfs migrate info --everything
migrate: Sorting commits: ..., done                                                                 
migrate: Examining commits: 100% (296/296), done                                                    
*.html  2.3 MB  144/144 files(s)    100%
*.rb    1.7 MB  699/712 files(s)     98%

Then use git lfs migrate import to convert their history to use Git LFS. For example, to convert all .spp files...

git lfs migrate import --include='*.spp' --everything
Schwern
  • 153,029
  • 25
  • 195
  • 336
  • Thanks for the suggestions. When I use `git lfs migrate info`, it gives `exit status 128`, unfortunately. Searching for that, it seems that happens to other as well. But I'll try to push forward on that path and see what I get. – Dan Jun 12 '18 at 18:39
  • @Dan Check your git and git-lfs are up to date. Try it with `GIT_TRACE=1` set. If that doesn't work, [try the BFG](https://confluence.atlassian.com/bitbucket/use-bfg-to-migrate-a-repo-to-git-lfs-834233484.html). – Schwern Jun 12 '18 at 22:38