Search code examples
gitgit-lfsgit-lfs-migrate

Files have become unreadbale post git lfs migrate import, how to undo


I did the following on my repository and now all the files have been replaced by statements like these(I have replaced the value in the second line with *s):

version https://git-lfs.github.com/spec/v1
oid sha256:8*****************************************93
size 1003203

lfs commands run:

git lfs install
git lfs track "*.xyz"
git lfs migrate import

Now all files including the xyz files are unreadable. How can I possibly undo these ?


Solution

  • import changes all the files to their SHA keys. Running the following helped my case:

    git lfs migrate export --include "*" 
    

    I used --include "*" here since I had run migrate export without an include flag and all the files were added to .gitattributes. In case of exclusive files being unreadable, do the following:

    git lfs migrate export --include "filepath/filename"