简体   繁体   English

Windows上的Git:无法创建前导目录错误

[英]Git on Windows: could not create leading directories error

I have installed MsysGit on Windows. 我在Windows上安装了MsysGit The following command invoked from the cmd.exe command-line gives error: 从cmd.exe命令行调用以下命令会出错:

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. Git Bash的命令提示符中发出的相同命令工作正常。

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. 此命令是从Vim内部发出的,因此我需要它来自cmd.exe。

don't use single quotes on windows cmd. 不要在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. 在您的情况下,路径中没有空格,因此不需要引号。

Eg 例如

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

Please refer to this issue in github of vunble. 请参阅vunble的github中的这个问题。

https://github.com/gmarik/vundle/issues/283 https://github.com/gmarik/vundle/issues/283

The solution is very simple, just comment the line of shellslash with '"' 解决方案非常简单,只需使用'\\ n''评论一行shelllash

Best wishes. 最好的祝愿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM