$ git diff --cached
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8ebb991..643e24f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -65,7 +65,8 @@ branch directly, things can get messy.
Please include a nice description of your changes when you submit your PR;
if we have to read the whole diff to figure out why you‘re contributing
in the first place, you‘re less likely to get feedback and have your change
-merged in.
+merged in. Also, split your changes into comprehensive chunks if your patch is
+longer than a dozen lines.
If you are starting to work on a particular area, feel free to submit a PR
that highlights your work in progress (and note in the PR title that it‘s
看懂git diff的输出结果:
下面是一个通常的git diff的输出结果:
$ git diff README.md
diff --git a/README.md b/README.md
index d29ab50..7e42b29 100644
第一部分表示为你使用的git格式的diff:
diff
第二部分表示两个版本的git哈希值(index区域的d29ab50对象,与工作目录区域的7e42b29对象进行比较),最后的六位数字是对象的模式(普通文件,644权限)。
index d29ab50..7e42b29 100644
第三部分表示进行比较的两个文件:
--- a/README.md
+++ b/README.md
"---"表示变动前的版本,"+++"表示变动后的版本。
第四部分表示变动的位置,用两个@作为起首和结束:
@@ -37,3 +37,4 @@
前面的"-37,3"分成三个部分:减号表示第一个文件(即index区域的d29ab50对象),"37"表示第37行,"3"表示连续3行。合在一起,就表示下面是第一个文件从第37行开始的连续3行。同样的,"+37,4"表示变动后,成为第二个文件从第37行开始的连续4行。
最后一部分是具体的差异部分:
You can get it using command `hostname` in your remote robot:
$ hostname
+Enjoy it!