I have a project with a lot of binaries (mostly pdfs) that I'm using git-lfs with. The project is about 60mb but I found that my .git/lfs/objects director is about 500mb. I presume these are cached versions of previous commits. Is there a way to gracefully delete these (ie delete them without corrupting the state of git)? The odds of me ever wanting previous versions of the files in LFS are near 0 now especially since the project is over.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I found the git-lfs man pages. It turns out there is a git lfs prune
command which does exactly what I needed:
C:\Path\to\project [master]> du -h -d 0
625M .
C:\Path\to\project [master]> git lfs prune
* 101 local objects, 88 retained
Pruning 13 files, (393.8 MB)
* Deleted 13 files
C:\Path\to\project [master]> du -h -d 0
231M .