Git Windows:无法使用空格克隆/签出存储库路径

时间:2017-03-13 06:35:27

标签: git github github-for-windows

我正在尝试使用包含空格的路径签出存储库。 git clone / checkout失败了。返回以下错误

fatal: cannot create directory at 'main-path/some-folder-with-space /another-folder': No such file or directory

已解决:

  1. 从github下载项目zip。
  2. 提取项目。
  3. git init
  4. git remote add origin git@github.com:MainRepo/project.git
  5. git fetch --all
  6. 项目现已成功克隆到我的Windows机器上。我可以检查远程分支,没有任何错误。

3 个答案:

答案 0 :(得分:0)

假设您在命令行中,您可以使用input.name = key;//'name-as-seen-at-the-server';转义空格。

我尝试了\

编辑:目标文件夹还包含空格。没问题。你能详细说明你试图克隆的 吗?你在使用命令行还是一些gui?

答案 1 :(得分:0)

使用较低版本的Git Bash(1.9.5)解决了这个问题。当我遇到此问题时,我使用的是2.5.1版。

答案 2 :(得分:0)

将地址放在引号

git clone "some/folder/with spaces/here.git"
相关问题