title: Prevent Jenkins pipeline commands from being executed in different shells
body: <p>I have the following code in my Jenkins pipeline script:</p>
  
  <pre><code>sh("alias git='/my/file/path/libexec/git-core/git'")
  mvn "-e -X release:prepare"
  </code></pre>
  
  <p>The second line is calling <code>git</code> and it fails with:</p>
  
  <pre><code>The git-tag command failed.
  Command output:
  /bin/sh: git: command not found
  Caused by: org.apache.maven.plugin.MojoFailureException: Unable to tag SCM
  </code></pre>
  
  <p>That shouldn't happen because I am aliasing it first.</p>
  
  <p>My suspicion is that the statements are ran in different shells.</p>
  
  <p>Is that true?
  In which case, how can I prevent this?</p>