Skip to content

Instantly share code, notes, and snippets.

@mslinn
Created April 26, 2019 04:42
Show Gist options
  • Select an option

  • Save mslinn/c199e5dbb1b921ad2329d76b069b687d to your computer and use it in GitHub Desktop.

Select an option

Save mslinn/c199e5dbb1b921ad2329d76b069b687d to your computer and use it in GitHub Desktop.
Run WSL git from native Windows apps
@echo off
rem Taken from https://stackoverflow.com/a/54106424/553865
setlocal enabledelayedexpansion
set command=%*
set find=C:\Users\%USERNAME%\AppData\Local\Temp\git-commit-msg-.txt
set replace=/mnt/c/Users/%USERNAME%/AppData/Local/Temp/git-commit-msg-.txt
call set command=%%command:!find!=!replace!%%
echo | C:\Windows\System32\bash.exe -c 'git %command%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment