Skip to content

Instantly share code, notes, and snippets.

@Zeryther
Created June 17, 2019 19:32
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 Zeryther/b01acffd501b21fdb885558d469b7870 to your computer and use it in GitHub Desktop.
Save Zeryther/b01acffd501b21fdb885558d469b7870 to your computer and use it in GitHub Desktop.
Use this as a replacement for the git executable in JetBrains IDEs to run Git from WSL - modified version of https://stackoverflow.com/a/43878654/4117923
@echo off
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\wsl.exe cd "`wslpath '%cd%'`" && git %command%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment