Interpreting git diff output -
this question has answer here:
- how read output git diff? 6 answers
i been using git years never used diff command , started use today don't understand output... had file , removed line 3 , 4 , got following output can me understand lines of output means in dummy terms. thanks
$ git diff diff --git a/readme.txt b/readme.txt index 15827f4..8115e72 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,2 @@ file adding -line 3 -
line 1: command used produce diff.
line 2: git database information 2 files involved.
line 3 , 4: --- means old file, +++ means new file.
line 5: @@ means range of lines represented in next diff hunk. -1,4 means lines 1-4 old file, , +1,2 means lines 1-2 in new file.
the remaining lines lines original files, prefixed either (a space), - or +. lines in both old , new, - in old , + in new.
these meant mnemonic: - "removed lines", "unchanged lines", , + "added lines".
Comments
Post a Comment