git and absolute Windows-style paths

Eliot Moss
Wed Apr 20 20:39:00 GMT 2016

I think this will do it:

function git {
   declare -a ARGS
   for n in "$@" ; do ARGS+=("$(cygpath -u -- "${n}")") ; done
   command git "${ARGS[@]}"

The reason this is a little more complicated than some other approaches
might be is that it will also work for arguments that have space, e.g.,

git add "C:/My Documents/foo.doc"

Regards -- Eliot

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list