Git on Windows: could not create leading directories error

git, windows

Solution

don't use single quotes on windows cmd. Use double quotes for paths with spaces, or no quotes at all when no spaces exist.

In your case, no spaces are in the path, so no quotes are necessary.

E.g.

C:\path\no\spaces               // ok
"C:\Program Files\Some Spaces"  // ok
'C:\Program Files\Foo'          // wrong.

Problem

I have installed MsysGit on Windows. The following command invoked from the cmd.exe command-line gives error: ``` C:\Users\joe>git clone 'git://github.com/MarcWeber/vim-addon-manager-known-repositories.git' 'C:/Users/joe/vim-addons/vim-addon-manager-known-repositories' fatal: could not create leading directories of ''C:/Users/joe/vim-addons/vim-addon-manager-known-repositories'': Invalid argument ``` The same command issued in the command prompt of Git Bash works fine. What do I fix to make the normal command-line version work? This command is issued from within Vim, so I need it to work from cmd.exe.

Original source