您能解释一下git show test.rb
和git show HEAD:test.rb
之间的区别吗?“git show test.rb”和“git show HEAD:test.rb”有什么区别?
命令git show HEAD:test.rb
返回:
test file contents
而git show test.rb
回报:
commit a8e90b3dbf4eed03cdbb3cd3b99f98e9153c7219
Author: Misha Moroshko <[email protected]>
Date: Thu Oct 27 17:03:04 2011
+1100
asd
diff --git a/test.rb b/test.rb new file mode 100644 index
0000000..b48e119
--- /dev/null
+++ b/test.rb @@ -0,0 +1 @@
+test file contents
@CharlesBailey:你错了。 –
@Charles Bailey - 不,你必须做'git show HEAD:file'来获取文件的内容。对于索引,'git show:a'。它在'gitrevisions'中明确指出# – manojlds
@manojlds:手册页的哪一部分提到'git show file'过滤器到'file'? –