理解git diff的前提,首先要理解git中工作区,暂存区,本地版本库的概念,如果头脑中有这些概念,接着往下读. git diff test.c 用来查看工作区和暂存区中test.c文件的区别. git diff HEAD -- test.c 用来查看工作区和本地版本库中test.c文件的区别. eg: a. 在工作区中修改文件cfm_test.c,git diff cfm_test.c 和 git diff HEAD -- cfm_test.c 分别输出如下: [3me]$ git dif…