Skip to content

Instantly share code, notes, and snippets.

@int128
Created August 25, 2016 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save int128/0b077bb4d596fde71ecf7e42eb47717e to your computer and use it in GitHub Desktop.
Save int128/0b077bb4d596fde71ecf7e42eb47717e to your computer and use it in GitHub Desktop.
Use Cygwin Git from command prompt

Use Cygwin Git from command prompt and other apps.

  1. Put git.cmd into the Cygwin root e.g. C:\cygwin64.
  2. Add the Cygwin root to the PATH environment variable.
@setlocal
@rem Get the absolute path to the current directory, which is assumed to be the Cygwin root.
@for /F "delims=" %%I in ("%~dp0") do @set cygwin_root=%%~fI
@set PATH=%cygwin_root%\bin;%PATH%
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@cd /d %HOME%
@call "%~n0" %*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment