阅读git diff输出

5
我刚开始学习如何使用git,并在以下文件上运行了git diff - 我有点困惑如何阅读输出结果 -
从我目前的理解来看,下面的内容说明工作目录和索引之间存在差异,与file01和file02相关。请问有谁能用英语解释一下输出结果中这部分的含义吗? --> @@ -1,4 +1 @@ 感谢您的帮助。
diff --git a/file01 b/file01
index cc17fa4..d0a432b 100644
--- a/file01
+++ b/file01
@@ -1,4 +1 @@
-datafiles
-file01
-file02
-file03
+This is a change
diff --git a/file02 b/file02
index e69de29..552c22e 100644
--- a/file02
+++ b/file02
@@ -0,0 +1 @@
+and this is another change
1个回答

8

@@ -1,4 +1 @@ 的意思是:

-1,4:这里有 4 行来自原始文件的内容,从第一行开始。

+1:这里有 1 行来自新版本的内容。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接