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

前端 未结 3 1459
北海茫月
北海茫月 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 10:00

    When last I was working with LFS, there were conversations on the project page about better integration - such as by writing diff and/or merge tools that could be plugged in via .gitattributes. These didn't seem to be considered high priority, since the main intended use case of LFS is to protect large binary files (but certainly I've come across multiple cases where either I had a large text file, or the only reasonable way to set up LFS tracking rules cast a wide enough net to catch some smaller text files). I'm not sure if there's been any progress on those tools, as I haven't looked at the project page in a while.

    Absent those things, there's not a particularly "slick" way to do what you're asking. You can set up two work trees and check out different versions. You can check out one version, rename it, and then check out the other.

提交回复
热议问题