-5

This is the output I get of the diff

diff --git a/README.md b/README.md
index cda48bc..95ce355 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
 THIS IS LINE 1
-THIS IS LINE 2
+THIS IS LINE X
 THIS IS LINE 3

File in workspace looks like this

 THIS IS LINE 1
 THIS IS LINE X
 THIS IS LINE 3

File in staging looks like this

 THIS IS LINE 1
 THIS IS LINE 2
 THIS IS LINE 3

So what does the following mean... I really don't understand the diff output

diff --git a/README.md b/README.md
index cda48bc..95ce355 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
 THIS IS LINE 1
-THIS IS LINE 2
+THIS IS LINE X
 THIS IS LINE 3
techsjs2013
  • 2,589
  • 5
  • 19
  • 24
  • 2
    seriously? Why are you asking this again? You just asked this a few minutes ago! – Nevik Rehnel Feb 15 '13 at 14:30
  • I just dont get it so I made a better example sorry – techsjs2013 Feb 15 '13 at 14:48
  • Then you should use comment on the answers to your original question, and possibly expand your question, not post almost the exact same question a second time. There is also Google, which would have shown you that there are many pages that explain the unified diff format – Nevik Rehnel Feb 15 '13 at 21:32

2 Answers2

4

The format and meaning of a Unified Diff is explained well on Wikipedia

Nevik Rehnel
  • 45,305
  • 6
  • 59
  • 49
2

You can read it like this:

-THIS IS LINE 2

+THIS IS LINE X

In the first file, the line "THIS IS LINE 2" is not present, and it is replaced instead by "THIS IS LINE X."

asf107
  • 1,078
  • 6
  • 22