title: How to make git status show only staged files
body: <p>I would like to get a list of only the staged filenames. I can't find the equivalent flag for <code>--name-only</code> for the <code>git status</code> command. What is a good alternative?</p>
  
  <p>The file list will be piped to <code>php -l</code> (PHP lint syntax checker).</p>
  
  <p><strong>Solution: the complete command</strong></p>
  
  <pre><code>git diff --name-only --cached | xargs -l php -l
  </code></pre>