git diff中的两个加号表示什么意思? [英] What do two plus signs in a git diff mean?

查看:761
本文介绍了git diff中的两个加号表示什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个 git diff ,并且第一次在行旁边看到双重加号。

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

这是什么意思?我GOOGLE了它,并且这个结果并没有真正解释它。我看了 man ,我发现的一个例子似乎也没有解释它:

  3。接着是两行文件/文件头

--- a / file
+++ b /文件

类似于两个传统的统一差异格式的线头,/ dev / null用于表示创建或删除的文件。

这是什么意思?我对文件进行了修改,使其大于以前版本的50%。它是否与文件重写有关?这是发生在我提交时发生的事情。

解决方案

这些行自上一版本开始添加。

从手册页:

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




在上面的输出示例中,函数签名已从
这两个文件中更改(因此两个 - 从file1和file2中删除两个,再加上++到
表示添加的一行不会出现在file1或
file2中)。另外还有八行与file1相同,但
不会出现在file2中(因此前缀为{plus})。

见diff手册:



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


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:

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.

解决方案

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

这篇关于git diff中的两个加号表示什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆