在git diff
的输出中,前两行是什么意思?
具体地,在下面的两个示例中:
diff --git a/file b/file
和diff --cc file
是什么意思?我以为它们的意思是git diff
正在调用diff
,但是diff
是否具有选项--git
和--cc
(man diff
没有显示它们) ?
index a29c52b..802acf8 100644
和index 4d77dd1,802acf8..0000000
是什么意思? (index
之后是一系列提交和一个提交吗?)
谢谢。
$ git diff
diff --git a/file b/file
index a29c52b..802acf8 100644
--- a/file
+++ b/file
@@ -2,3 +2,5 @@ Line 1 stuff
Line 2 stuff
Line 3 stuff
Line 4 alternate stuff
+Line 5 alternate stuff
+Line 6 alternate stuff
$ git diff
diff --cc file
index 4d77dd1,802acf8..0000000
--- a/file
+++ b/file
@@@ -2,5 -2,5 +2,10 @@@ Line 1 stuf
Line 2 stuff
Line 3 stuff
Line 4 alternate stuff
++<<<<<<< HEAD:file
+Line 5 stuff
+Line 6 stuff
++=======
+ Line 5 alternate stuff
+ Line 6 alternate stuff
++>>>>>>> alternate:file