我曾经通过使用来git difftool
获得 2 次提交之间的差异context
git difftool -y -x "diff -c" $1 $2 >>./tempFiles/diffAll.txt
这里是两个提交哈希$1
,$2
它们作为命令行参数传递给包含上述代码的 shell 脚本。在这里提到的上下文格式中,我们可以很容易地识别出被修改(带!
标记)、添加(带+
标记)和删除(带-
标记)的行。我从上面得到的部分输出如下(从最新到最旧),
最新提交
*** modules/p2-profile-gen/pom.xml 2016-11-30 12:39:29.882731844 +0530
--- /tmp/i1pg5a_pom.xml 2016-12-06 14:35:03.860669316 +0530
***************
*** 1300,1309 ****
<id>org.wso2.carbon.identity.authz.server.feature.group</id>
<version>${carbon.identity.auth.version}</version>
</feature>
! <feature>
! <id>org.wso2.carbon.identity.context.rewrite.server.feature.group</id>
! <version>${carbon.identity.auth.version}</version>
! </feature>
</features>
</configuration>
--- 1292,1298 ----
<id>org.wso2.carbon.identity.authz.server.feature.group</id>
<version>${carbon.identity.auth.version}</version>
</feature>
!
</features>
</configuration>
旧提交
*** /tmp/caN3su_pom.xml 2016-12-06 14:35:04.260667699 +0530
--- modules/p2-profile-gen/pom.xml 2016-11-30 12:39:29.882731844 +0530
***************
*** 1292,1298 ****
<id>org.wso2.carbon.identity.authz.server.feature.group</id>
<version>${carbon.identity.auth.version}</version>
</feature>
!
</features>
</configuration>
--- 1300,1309 ----
<id>org.wso2.carbon.identity.authz.server.feature.group</id>
<version>${carbon.identity.auth.version}</version>
</feature>
! <feature>
! <id>org.wso2.carbon.identity.context.rewrite.server.feature.group</id>
! <version>${carbon.identity.auth.version}</version>
! </feature>
</features>
</configuration>
有人可以帮我弄清楚!
标记在这里的实际含义。