Git: what does the number of +/- signs in diff / merge output mean?

Possible Duplicate:
Git Merge: What does this mean?
Git diff –stat explanation

Sorry for the stupid question, but i can’t find a clear answer anywhere.

  • .gitattributes not making a difference, trying to skip files when using git difftool
  • In the context of git (and diff), what is a “hunk”
  • how do I keep git config entries across pulls
  • Diff branches in Atlassian Stash
  • How to compare a file with a commit from X versions ago
  • How to make git ignore certain file conflicts and differences?
  • When you merge two branches in git, you get an output like that :

     some_file.txt  |  564 ++++++++++++++--
    

    I undestand that + and - 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

  • Mirroring git branch
  • Trying to understand what Travis CI does and when it should be used
  • Is it possible to make Git aware of SVN revisions?
  • Git: How can I put a commit between older commits without changing the files/folders of later commits?
  • local cache for a github repository?
  • Is it possible to switch the user on a git repo?
  • 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.

    EDIT:
    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(-)
    

    On 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%).
    On 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.

    Git Baby is a git and github fan, let's start git clone.