title: How do I list all folder names that have files changed in Git?
body: <p><code>git diff --name-only</code> or <code>git diff --name-status</code> will list all files that have been changed, however there is no command to list all folder names that contain files changed.</p>
  
  <p>For example, with this directory tree:</p>
  
  <pre><code>test/
  |
  |__B/
  |
  |____b1.txt
  |
  |__C/
  |
  |____c1.txt
  </code></pre>
  
  <p>If <code>b1.txt</code> and <code>c1.txt</code> have changed, I'd like to get <code>B</code> and <code>C</code> as the output.</p>