我的命令:git show --pretty="format:" --name-only
返回文件列表。然后我使用 xargs 对这些文件运行 shell 脚本:
git show --pretty="format:" --name-only | xargs -i phpmd $dir/'{}' text codesize,unusedcode,naming
Run Code Online (Sandbox Code Playgroud)
但是,我想仅对具有.php
扩展名的文件运行该 xargs 命令。如何过滤不需要的文件?