在`git diff`的输出中,前两行是什么意思?

时间:2019-01-11 13:25:36

标签: git

git diff的输出中,前两行是什么意思?

具体地,在下面的两个示例中:

diff --git a/file b/filediff --cc file是什么意思?我以为它们的意思是git diff正在调用diff,但是diff是否具有选项--git--ccman diff没有显示它们) ?

index a29c52b..802acf8 100644index 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

0 个答案:

没有答案