是否有一个命令可以接受ref和文件路径,并输出文件的全部内容,因为它是在STDOUT的提交时?
例如.像这样的东西:
git show-me-the-file HEAD~2 some/file | do_something_with_piped_output_here
Run Code Online (Sandbox Code Playgroud)
eqz*_*qzx 46
git show
例如
git show HEAD:./<path_to_file>
git show <ref spec>:<path>
例如,如果要在提交点9be20d1bf62查看文件,则执行以下操作:
git show 9be20d1bf62:a/b/file.txt
如果你想在特定分支上看到文件:
git show <branch name>:<path>