I have a git lfs repository checked out. All the binaries are pointers. I pulled the real binaries with git lfs pull --include some/binaries
.
I used the binaries and now I would like to "unpull" the binaries and convert them to the pointers again, so I can reclaim the disk space.
I didn't find any suitable command to do that, and mangling with .git/lfs/objects plus hard resets make me nervous.
Question: How to convert the tracked binaries back to pointers?
Edit:
An open LFS issue suggested to run
git read-tree HEAD && GIT_LFS_SKIP_SMUDGE=1 git checkout -f HEAD
Note:
If you run that in a dirty working tree, you'll blow away your changes, so don't do that.
source
This worked for me, unlike the script in the top answer. (maybe because I am using lfs inside a git submodule)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With