2

In the output of git diff, what do the first two lines mean?

Specifically, in the following two examples:

What do diff --git a/file b/file and diff --cc file mean? I thought they mean that git diff is invoking diff, but does diff have options --git and --cc (man diff doesn't show them)?

What do index a29c52b..802acf8 100644 and index 4d77dd1,802acf8..0000000 mean? (Is index followed by a range of commits and a commit?)

$ 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 
3
  • Looks like a commit hash but I'm not positive Commented Jan 11, 2019 at 13:28
  • First looks like a standard diff, the second looks like a conflict diff. Commented Jan 11, 2019 at 13:32
  • Side note: you'll have to dig through answers other than the accepted one to find what the index line means, but just search for index. Commented Jan 11, 2019 at 19:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.