We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5bf386 commit 4154609Copy full SHA for 4154609
1 file changed
git-cmd.bat
@@ -1,7 +1,15 @@
1
-@set PLINK_PROTOCOL=ssh
+@rem Do not use "echo off" to not affect any child calls.
2
@setlocal
3
+
4
+@rem Get the abolute path to the current 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
-@set path=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
-@if "%HOME%"=="" @set HOME=%USERPROFILE%
7
+@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
8
9
+@if not exist "%HOME%" @set HOME="%HOMEDRIVE%%HOMEPATH%"
10
+@if not exist "%HOME%" @set HOME="%USERPROFILE%"
11
12
+@set PLINK_PROTOCOL=ssh
13
14
@cd %HOME%
15
@start %COMSPEC%
0 commit comments