title: git alias for shell command to cd into git root not working as expected
body: <p>I'm trying to define an alias to <code>cd</code> me into the git root directory using <code>git rev-parse --show-toplevel</code>. </p>
  
  <p>Currently I have it as an alias in my <code>.bashrc</code>, which works fine: </p>
  
  <pre><code>alias gitroot='cd "$(git rev-parse --show-toplevel)"'
  </code></pre>
  
  <p>But I know that you can run shell commands using git aliases, so I thought I'd move the command into my <code>.gitconfig</code> to make my files a bit cleaner. </p>
  
  <p>Problem is, I can't figure out why my alias isn't working. Currently I have this under <code>[alias]</code> in my <code>.gitconfig</code>:</p>
  
  <pre><code>root = "!sh -c 'cd \"$(git rev-parse --show-toplevel)\"'"
  </code></pre>
  
  <p>But when I run <code>git root</code>, I just stay put in the current directory. </p>
  
  <p>I've experimented with other shell aliases and they've worked, e.g. the alias <code>say = "!sh -c 'echo \"$0\"'"</code> works just fine: </p>
  
  <pre><code>$ git say hello
  hello
  </code></pre>
  
  <p>Though I've noticed that a similar <code>cd</code> command (<code>cd = "!sh -c 'cd \"$0\"'"</code>) fails:</p>
  
  <pre><code>~/repos/myproject$ git cd /home/
  ~/repos/myproject$
  </code></pre>
  
  <p>I can't figure out if it's something to do with my syntax or if it's a quirk of git aliases that it doesn't support the <code>cd</code> command, or something else entirely.</p>
  
  <p>If it helps, I'm using Git 1.7.9.5. </p>