Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding missing LFS files that causes: Encountered X file(s) that should have been pointers, but weren't

Tags:

git

git-lfs

I've got a git repository that had existing files in it. I then setup git-lfs to handle files of particular types (e.g. pdf, tif etc). This works fine for new files and they are stored in LFS as expected. However, files that were already in the repo but should have been stored in LFS aren't. This leads to the error below when cloning the repo:

Encountered 361 file(s) that should have been pointers, but weren't:

How can I convert these files over so that they are stored in LFS rather than in git? I don't care about rewriting history, just need to tidy this up for moving forward.

like image 774
Matthew van Boheemen Avatar asked Sep 16 '25 05:09

Matthew van Boheemen


1 Answers

How I solved it:

git lfs migrate import --no-rewrite path

See: https://tech-notes.maxmasnick.com/fixing-files-that-should-have-been-pointers-in-lfs-but-werent

like image 112
derekhh Avatar answered Sep 17 '25 20:09

derekhh