Skip to content

Instantly share code, notes, and snippets.

@dantmnf
Last active November 4, 2017 16:29
Show Gist options
  • Save dantmnf/bca20b670ce6b14bf9c16d630c355ed7 to your computer and use it in GitHub Desktop.
Save dantmnf/bca20b670ce6b14bf9c16d630c355ed7 to your computer and use it in GitHub Desktop.
use cygwin git in vscode
@D:/cygwin64/bin/bash.exe /usr/bin/gitwrapper.sh "%*"
#!/bin/bash
PATH="/usr/bin:$PATH"
args=()
for arg in $1
do
if [ "${arg:1:2}" = ':\' ]
then
args+=("$(cygpath -u "$arg")")
elif [[ ${arg:0:4} == :?:\\ ]]
then
args+=(":$($(cygpath -u "${arg:1}"))")
else
args+=("$arg")
fi
done
if [ "${args[0]}" = rev-parse ] && [ "${args[1]}" = "--show-toplevel" ]
then
result="$(git "${args[@]}")"
s="$?"
cygpath -w "$result"
exit "$s"
else
exec git "${args[@]}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment