1

I am trying to find out what does the "-" mean in the git diff I get. It is not a new line because when I add a line I get a "+".

diff --git a/webapp/pom.xml b/webapp/pom.xml index 73486d22a..a58a214c3 100755 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -180,7 +180,6 @@ <version>1.5.8</version> </dependency> --> - </dependencies> <profiles> 
3

3 Answers 3

2

It means the line was removed in the newer file.

Excerpt from the git diff documentation:

 A - character in the column N means that the line appears in fileN but it does not appear in the result. A + character in the column N means that the line appears in the result, and fileN does not have that line (in other words, the line was added, from the point of view of that parent). 
Sign up to request clarification or add additional context in comments.

Comments

1

Here is details about the git diff

https://git-scm.com/docs/git-diff

Specified the character used to indicate new, old or context lines in the generated patch. Normally they are +, - and ' ' respectively.

Comments

0

From the git diff manual

https://git-scm.com/docs/git-diff:

A "combined diff" format looks like this:

diff --combined describe.c index fabadb8,cc95eb0..4866510 --- a/describe.c +++ b/describe.c @@@ -98,20 -98,12 +98,20 @@@ return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; } - static void describe(char *arg) -static void describe(struct commit *cmit, int last_one) ++static void describe(char *arg, int last_one) { + unsigned char sha1[20]; + struct commit *cmit; struct commit_list *list; static int initialized = 0; struct commit_name *n; + if (get_sha1(arg, sha1) < 0) + usage(describe_usage); + cmit = lookup_commit_reference(sha1); + if (!cmit) + usage(describe_usage); + if (!initialized) { initialized = 1; for_each_ref(get_name); 

It is followed by two-line from-file/to-file header

--- a/file +++ b/file 

Similar to two-line header for traditional unified diff format, /dev/null is used to signal created or deleted files.

1 Comment

The example in the question is a regular diff, not a combined diff. (It probably would be useful if the Git documentation described a regular diff before diving into the combined diff format.)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.