Skip to content

Instantly share code, notes, and snippets.

@xymopen
Last active December 16, 2020 14:19
Show Gist options
  • Save xymopen/1be836c5ddc43abf409611d56d0705be to your computer and use it in GitHub Desktop.
Save xymopen/1be836c5ddc43abf409611d56d0705be to your computer and use it in GitHub Desktop.
Start a cmd with MinGW come with Git for Windows
@echo off
setlocal
for /f "delims=" %%i in ('where git') do (
set "GIT_PATH=%%~dpi"
goto _end_of_where
)
:_end_of_where
if "%GIT_PATH:~-1%" == "\" (
set "GIT_PATH=%GIT_PATH:~0,-1%"
)
set "PATH=%GIT_PATH%\..\usr\bin;%GIT_PATH%\..\mingw64\bin;%GIT_PATH%\..\mingw32\bin;%PATH%"
cmd
endlocal
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment