title: Dynamic Visual Studio Debug Arguments
body: <p>I have a program which accepts a git branch name as a parameter, so a normal run might look like:</p>
  <pre><code>    tool.exe --branch My-Feature-Branch
  </code></pre>
  <p>When debugging in Visual Studio I'd like it to use the current git branch.</p>
  <p>I know I can get the name of the current branch with the command <code>git rev-parse --abbrev-ref HEAD</code>. However, if I use this in the debug command arguments I always get a null value.</p>
  <p>Command arguments I've tried:</p>
  <pre><code>    --branch $(git rev-parse --abbrev-ref HEAD)
      --branch &quot;$(git rev-parse --abbrev-ref HEAD)&quot;
      --branch (git rev-parse --abbrev-ref HEAD)  &lt;- VS complains about rev-parse not being a command
      --branch $(git -C C:/repo/root rev-parse --abbrev-ref HEAD)
  </code></pre>