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 Use git diff --name-only (with --cached to get the staged files) The accepted answer won't let you know what kind of changes were there. Yes, If you are not syntax checker but an ordinary person with a repository full of unstaged files, and you still want to know what will happen to staged