How to print a Git LFS file's old version to stdout (git show / git cat-file for LFS)?

前端 未结 3 1482
北海茫月
北海茫月 2020-12-19 09:15

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 i

3条回答
  •  被撕碎了的回忆
    2020-12-19 09:53

    Piping an lfs pointer into git lfs smudge will yield you what you want. For example:

    git cat-file blob  | git lfs smudge
    

    Or if you have a commit-ish (a commit hash, branch name, just HEAD, etc.) and a file name:

    git cat-file blob :path/to/my-large-file.name | git lfs smudge
    

    You could redirect the output into a file.

提交回复
热议问题