Git diff --stat explanation

后端 未结 3 526
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-05 13:04

Git\'s pull output has been explained here fairly well. In spite of this I\'m still unsure exactly what the text graph relates to.

For example:

git di

3条回答
  •  伪装坚强ぢ
    2020-12-05 13:20

    As I answered here:

    It supposed to reflect the amount of changes (in lines) of each file listed.
    Plus signs for additions, minuses for deletions.

    The 118 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.

    The amount of signs per line the a GCD multiple that fits the line width.

    Hope that helps.

提交回复
热议问题