What do two plus signs in a git diff mean?

前端 未结 2 1442
抹茶落季
抹茶落季 2020-12-31 02:23

I am doing a git diff and for the first time, I am seeing double plus-signs next to lines.

++        if ($field_name == $selected) {
++
++              


        
2条回答
  •  难免孤独
    2020-12-31 02:55

    These lines are added since the last version.

    From the manual page:

    - static void describe(char *arg)
     -static void describe(struct commit *cmit, int last_one)
    ++static void describe(char *arg, int last_one)
    

    In the above example output, the function signature was changed from both files (hence two - removals from both file1 and file2, plus ++ to mean one line that was added does not appear in either file1 nor file2). Also eight other lines are the same from file1 but do not appear in file2 (hence prefixed with {plus}).

    See diff manual:

    https://www.kernel.org/pub/software/scm/git/docs/v1.7.3/git-diff.html

提交回复
热议问题