Git Windows:无法克隆/检出带空格的存储库路径

ari*_*ele 5 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
Run Code Online (Sandbox Code Playgroud)

解决:

  1. 从github下载项目zip。
  2. 提取项目。
  3. git初始化
  4. git remote add origin git@github.com:MainRepo / project.git
  5. git fetch --all

现在,项目已成功克隆到我的Windows计算机上。我可以签出远程分支,而不会出现任何错误。

kow*_*sky 0

假设您在命令行上,您可以使用 转义空格\

我尝试过与git clone ../some\ folder\ with\ spaces/.

编辑:目标文件夹还包含空格。没问题。您能详细说明一下您是如何尝试克隆的吗?你使用的是命令行还是一些图形用户界面?

  • 它看起来不像**包含**空格,它看起来**以**空格结尾。 (3认同)