title: How to get AndroidStudio's git path setting
body: <p>I'm trying to use the method described in this other SO question to generate the version info for an Android application:</p>
  
  <p><a href="https://stackoverflow.com/questions/17097263/automatically-versioning-android-project-from-git-describe-with-android-studio-g/24121734#24121734">Automatically versioning Android project from git describe with Android Studio/Gradle</a></p>
  
  <p>The method depends on calling the <code>git</code> command from the gradle script. One requirement seems to be that <code>git</code> be in the path environment variable.</p>
  
  <p>Is there a way to obtain this path from AndroidStudio's git settings?
  (Version Control > Git: Path to Git Executable) I'd prefer if I didn't have to set up the environment variable and avoid hardcoding the directory where <code>git</code> is installed.</p>
  
  <p><img src="https://i.stack.imgur.com/vV92F.png" alt="screenshot of git configuration settings"></p>
  
  <p>For reference, here's the method to obtain the version name from the linked question:</p>
  
  <pre><code>def getVersionName = { -&gt;
      try {
          def stdout = new ByteArrayOutputStream()
          exec {
              commandLine 'git', 'describe', '--tags', '--dirty'
              standardOutput = stdout
          }
          return stdout.toString().trim()
      }
      catch (ignored) {
          return null;
      }
  }
  </code></pre>