1、新建且未git追踪的文件
git ls-files -o --exclude-standard | xargs ./scripts/checkpatch.pl -f
2、git add前检查所有“修改”文件的编码规范
git diff --stat --name-only | xargs ./scripts/checkpatch.pl -f
3、检查最近一次“提交”的文件编码规范
git log --name-only -1 --pretty=format: | xargs ./scripts/checkpatch.pl -f
4、git status 查看最近提交log
5、回到某个版本
git reset --hard bba98b602bdc2b3394df0e6ac387d1b6ebba1e30
6. 检查代码规范
scripts/checkpatch.pl -f drivers/mtd/spi-nor/cadence-quadspi.c