Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading git diff output

Tags:

git

github

diff

I am just starting to learn how to use git and have run git diff on the files below - Im a bit confused about how you read the output -

From what I understand so far the below is saying there is a difference between the working directory and the index in relation to file01 and then file02. Could someboby explain in english how you read this part of the output --> @@ -1,4 +1 @@

Thanks for your help

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
like image 631
frodo Avatar asked Dec 13 '12 13:12

frodo


1 Answers

The @@ -1,4 +1 @@ means:

-1,4: here are 4 lines from the original starting from line 1.

+1 and here is 1 line from the new version.

like image 158
n.r. Avatar answered Sep 18 '22 04:09

n.r.