git: show all modified files - staged and not staged
<p>I need a command which gives me <strong>all modified files</strong> - this includes staged (i.e. newly added files) and non-staged changes - in a <strong>plain list</strong> which I can use in a script. While this question might sound familiar I only find commands that come close to what I want to do:</p>

<pre><code>git ls-files -m
</code></pre>

<p>.. lists (non staged) modifications <em>but ignores staged and newly
added files</em></p>

<pre><code>git diff --name-only
</code></pre>

<p>.. will also <em>only list non staged</em> modifications </p>

<pre><code>git diff --name-only --cached
</code></pre>

<p>.. lists <em>only staged</em> modifications but omits files with non-staged
modifications</p>

<pre><code>git status --porcelain --untracked-files=no
</code></pre>

<p>.. outputs all files I want to see but <em>adds the status</em></p>

<p>I could play with <code>git status</code> of course and <code>cut</code> the first entry but since I want to integrate this command in a CMake script which will be used on windows, too. So one single command would be fine..</p>