title: Get the path where git alias was run from
body: <p>When an external command is run via Git alias, it is run from the rood directory of the repository (where the .git/ is usually located). It can be checked with:</p>
  
  <pre><code>$ cd /some/path/inside/repo
  $ echo $(git -c alias.root='!pwd' root)
  </code></pre>
  
  <p>Now, <strong>is there a way to get the exact path where the alias was run from?`</strong></p>
  
  <hr>
  
  <p>In case of XY problem, here's what I'm doing: I want an alias that launches shell function which, in its turn, runs several Git commands, like ls-files. It should work only in the path where it was called, so it should know it.</p>
  
  <p>It works well if I just run the function, because it doesn't change paths and runs exactly where it was called. But I want a little more native behaviour. What I have now is</p>
  
  <pre><code>git-add-specificname -opt -opt2 --long-option -- path1 path2
  </code></pre>
  
  <p>What I want is</p>
  
  <pre><code>git add-specificname -opt -opt2 --long-option -- path1 path2
  </code></pre>
  
  <p>Aliasing parameters in Git is not allowed, so no chance for <code>git add specificname...</code></p>