【发布时间】:2021-08-27 18:39:08
【问题描述】:
所以在尝试了多个tutorials、questions/answers 之后,我仍然无法让git sparse-checkout 使用git 2.25 在 Windows 10 上工作
背景
我们的 repo 最近从 perforce 移动到 git,现在我正试图让 git 使用我的 repo 在 Windows 上工作,但失败得很惨。
repo 本身是巨大的 20GB,其中有名称为 aux.c,aux.h,nul 的文件,这些文件在 Windows 中无效。使用 Perforce,在 Windows 上仅映射所需的目录并使用它很简单。我当然不需要 Windows 上的那些文件
我一直在尝试的事情
git clone --no-checkout --depth=1 <repo-url> test-dir
cd test-dir
git sparse-checkout init --cone
但sparse-checkout 试图从失败的目录中获取名为nul 的文件
所以我将sparse-checkout init替换为
git config core.sparsecheckout true
echo 'automation/python/my-automation' >> .\git\info\sparse-checkout
git read-tree -mu HEAD
由于nul 文件'automation/ruby/.../nul',它再次遇到invalid path 错误
我想也许我遇到了here 描述的问题,所以我将git 版本从 2.27 降级到 2.25,但运气不好:(
如何从结帐中跳过这些不必要的文件并仅使用一个目录?我不能要求其他团队删除他们的文件 :)
【问题讨论】:
-
抱歉,我的意思是
.git\info\sparse-checkout,现在已修复 -
这个有什么帮助/意见吗??
-
反斜杠不是 unix 环境中的路径分隔符。使用正斜杠。反斜杠是语法转义。
-
@jthill 我都尝试过,但无法正常工作。这里提供的解决方案,github.com/uvdl/linux-fslc/issues/1 对我不起作用
-
这个好像差不多。
core.protectNTFS falsestackoverflow.com/questions/63727594/…