Last active
November 4, 2017 16:29
-
-
Save dantmnf/bca20b670ce6b14bf9c16d630c355ed7 to your computer and use it in GitHub Desktop.
use cygwin git in vscode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@D:/cygwin64/bin/bash.exe /usr/bin/gitwrapper.sh "%*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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