在不使用 `git checkout` 的情况下获取某些提交中的文件内容
Get content of file in some commit without using `git checkout`
有没有办法在不使用 git checkout
的情况下(因为它污染了工作目录)在某些提交中获取文件的完整内容(不仅仅是差异)?
像这样:
$ git content 43fb721 --file main.rb => "class Main\nend\r"
$ git show HEAD~4:main.rb
$ git show <commit>:<filename>
正是我需要的。
有没有办法在不使用 git checkout
的情况下(因为它污染了工作目录)在某些提交中获取文件的完整内容(不仅仅是差异)?
像这样:
$ git content 43fb721 --file main.rb => "class Main\nend\r"
$ git show HEAD~4:main.rb
$ git show <commit>:<filename>
正是我需要的。