How to make git status show only staged files
I would like to get a list of only the staged filenames. I can't find the equivalent flag for --name-only
for the git status
command. What is a good alternative?
The file list will be piped to php -l
(PHP lint syntax checker).
Solution: the complete command
git diff --name-only --cached | xargs -l php -l
使用git diff --name-only
(使用--cached
获取暂存文件)
上一篇: Git diff HEAD vs
下一篇: 如何让git状态仅显示暂存的文件