Diff

1 "git diff"

与暂存区相比,对未存档的文件做哪些修改;

2 --staged, HEAD

2.1 已存档的文件,查看暂存区和最近提交的历史文件的区别

"git diff --stages"

2.2 查看文件修改与最新提交的历史文件的区别

"git diff HEAD"

其中,HEAD表示最后一次提交的别名;HEAD^表示前一次提交的别名;HEAD~n标识前n次提交的别名;

3 --color-words, --word-diff

针对长行小改动,使用如下命令查看区别

"git diff --color-words"

"git diff --word-diff"

4 --stat

"git diff-stat" 只查看哪个文件修改


你可能感兴趣的:(Diff)