Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在特定提交中显示文件的内容,这是我正在使用的命令:
git show ($commit)^:($filename)
但是,它显示了上一次提交的内容。我不确定这个命令是否应该在提交“之前”获取内容,或者是因为我指定的提交是为了恢复之前的提交。
运算符的^意思是“给定提交的祖先”。只需删除它,你应该没问题:
^
$ git show ($commit):($filename)