Another title for this question could be 'How to checkout multiple versions of a Git-LFS managed file?'
I would like to inspect several versions of a file stored in Git-LFS. I would therefore like to several versions of this file side-by-side in my working directory. Something like this is what I have in mind:
git show v1:./myfile.ipynb > myfile-v1.ipynb
git show v2:./myfile.ipynb > myfile-v2.ipynb
This does not work as desired: the file is managed by Git-LFS, so to git show
its contents at each version looks like
version https://git-lfs.github.com/spec/v1
oid sha256:62aafe00ec8b61a37dd729e7d3a723382...
size 20439
I am interested in the file's 'true', Git-LFS-managed contents, rather than the pointer file that LFS stores in Git's own tree.
How can I create untracked, custom-named files that each contain a specific version of a file tracked by Git-LFS? This does not need to be a single command, I am resigned to Git needing multi-step scripts for single-concept actions.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…