Git: what does the number of +/- signs in diff / merge output mean?
Git Merge: What does this mean?
Git diff –stat explanation
Sorry for the stupid question, but i can’t find a clear answer anywhere.
When you merge two branches in git, you get an output like that :
some_file.txt | 564 ++++++++++++++--
I undestand that
- mean addition and deletion, but :
what does the number of signs represent ?
when you have few changes, each sign seem to represent a line, but when you have more signs, i can’t get the logic of the representation
is it some sort of percentage of changes ? My guess is that the number of signs represents a relative amount of changes – but relative to what ? current file ? the whole merge ?
how is it calculated ? Is there any official source about this ? The most accurate answer i had on this by now is “this representation is not very precise”… i’m just curious
One Solution collect form web for “Git: what does the number of +/- signs in diff / merge output mean?”
It supposed to reflect the amount of changes (in lines) of each file listed.
Plus signs for additions, minuses for deletions.
the 564 gives the amount of changed lines, and the – / + gives you the proportion of deletions/additions.
When the amount of changes can fit a line you’ll get ‘+‘ per addition, ‘–‘ per deletion;
Otherwise, this is an approximation, e.g.
CHANGES.txt | 47 +++++++++++++++++++++++++++++++++ make-release.py | 77 +++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 102 insertions(+), 22 deletions(-)
CHANGES.txt since you can see that there are no ‘–‘, and since 47 ‘+‘ are a lot you have a proportionate amount of them (i.e. 100%).
make-release.py you’ll see x39 ‘+‘ standing for 55 additions and x16 ‘–‘ standing for 22 deletions.
Exactly as their proportion, and just the amount to fit output screen.
Hope that helps.