1 @rem
Do not use "echo off" to
not affect any child calls.
4 @rem Get the abolute
path to the parent directory
, which is assumed to be the
5 @rem Git installation root.
6 @
for /F
"delims=" %%I in
("%~dp0..") do @
set git_install_root
=%%~fI
7 @
set PATH=%git_install_root%\bin
;%git_install_root%\mingw
\bin
;%PATH%
9 @
if not exist "%HOME%" @
set HOME
=%HOMEDRIVE%%HOMEPATH%
10 @
if not exist "%HOME%" @
set HOME
=%USERPROFILE%
12 @
set PLINK_PROTOCOL
=ssh
13 @
if not defined TERM
set TERM
=msys
15 @
if "%1"=="gui" @
goto gui
18 @rem Get the current console
("OEM") codepage.
19 @
for /f
%%i in
('getcp -oem') do @
set cp_oem
=%%i
20 @rem Get the current GUI
("ANSI") codepage.
21 @
for /f
%%i in
('getcp -ansi') do @
set cp_ansi
=%%i
22 @rem
Set the console
codepage to match the GUI
codepage.
23 @
chcp %cp_ansi% > nul
< nul
25 @
set ErrorLevel=%ErrorLevel%
26 @rem
Restore the original console
codepage.
27 @
chcp %cp_oem% > nul
< nul
31 @
if "%2"=="citool" @
goto default
32 @
for /f
"tokens=1-1*" %%a in
("%*") do @
set args
=%%b
33 @
start "git-gui" wish.exe
"%git_install_root%\libexec\git-core\git-gui" -- %args%
36 @
"%COMSPEC%" /c
exit /b
%ErrorLevel%