您能解釋一下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'? –