 <p>If you consider what <strong><a href="https://github.com/msysgit/msysgit/blob/devel/git-cmd.bat" rel="nofollow"><code>git-cmd.bat</code></a></strong> does, all you need to do is to set the right variable <code>%PATH%</code> before your git commands in your script:</p> <p>If you don't, here is what you would see:</p> <pre><code>C:\Users\VonC&gt;git --version 'git' is not recognized as an internal or external command, operable program or batch file. </code></pre> <p>I have uncompressed the <a href="http://code.google.com/p/msysgit/downloads/list" rel="nofollow">latest portable version of msysgit</a>.</p> <p>Put anywhere a <code>test.bat</code> script (so no powershell involved there) with the following content:</p> <pre><code>@setlocal @set git_install_root="C:\Users\VonC\prg\PortableGit-1.7.11-preview20120620" @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH% @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @set PLINK_PROTOCOL=ssh REM here is the specific git commands of your script git --version echo %HOME% git config --global --list </code></pre> <p>Make sure <code>HOME</code> is correctly set, because Git will look for your global git config there.</p> <p>The result will give you:</p> <pre><code>C:\Users\VonC&gt;cd prog\git C:\Users\VonC\prog\git&gt;s.bat C:\Users\VonC\prog\git&gt;git --version git version 1.7.11.msysgit.0 C:\Users\VonC\prog\git&gt;echo C:\Users\VonC C:\Users\VonC C:\Users\VonC\prog\git&gt;git config --global --list user.name=VonC </code></pre> <p>Note: that same script would work perfectly from a powershell session.</p>