Skip to content

Instantly share code, notes, and snippets.

@broomerr
broomerr / git_wsl
Created October 1, 2021 11:01 — forked from broomerrctr/git_wsl
git when in unix, git.exe when in wsl. Need to place to /usr/local/bin/
#!/bin/sh
GIT_WINDOWS="/mnt/c/Program Files/Git/cmd/git.exe"
GIT_LINUX="/usr/bin/git"
case "$(pwd -P)" in
/mnt/?/*) exec "$GIT_WINDOWS" "$@" | sed "s#^\([A-E]\):/#/mnt/\L\1/#" ;;
*) exec "$GIT_LINUX" "$@" ;;
esac