What do two plus signs in a git diff mean?

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

++        if ($field_name == $selected) {
++
++        echo "field_type: {$field['type']}\n";
++        echo "field_name: {$field_name}\n";
++
++        foreach ( $node->$field_name as $language => $value ) {

What does it mean? I googled it, and this result doesn’t really explain it. I looked at man and the one example I found doesn’t seem to explain it either:

  • Unable to connect to gitlab
  • How to check if the commit exists in a Git repository by its SHA-1
  • Git: restore my changes which were amended to merge commit
  • Not able to push the edited file in github
  • PowerShell, vim and aliases vs. *.cmd (when using git)
  • What is a Git Revision Expression?
  • 3. 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.
    

    What does it mean? I’ve made changes to the file that are greater than 50% of the previous version. Does it have to do with a file re-write? That’s what happened when I committed it.

  • application error on the web after you git push to Heroku
  • Git rebase error: This application will not run on your computer
  • Git split inital commit into 2
  • If I have merged a Git branch to master, can I delete the branch itself?
  • git svn and rebasing a branch rebases master
  • How do I preserve the time of a commit that is to be squashed into another?
  • 2 Solutions collect form web for “What do two plus signs in a git diff mean?”

    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

    The ++ in diff output is from a “combined diff”, which is the default format for git diff when showing merges (or when using the -c, -cc or -m options)

    When viewing a combined diff, if the two files you’re comparing have a line that’s different from what they were merged into, you will see the ++ to represent:

    one line that was added does not appear in either file1 or file2

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