Windows下带有符号链接的git克隆错误

Windows下带有符号链接的git克隆错误,windows,git,symlink,git-clone,Windows,Git,Symlink,Git Clone,我收到警告:当使用git clone时,以下路径发生冲突,例如,不区分大小写文件系统上的区分大小写路径,并且只有来自同一冲突组的一个路径位于工作树错误中: git clone -c core.symlinks=true ssh://root@11.22.33.44/etc c/Dev/GIT/mysite-etckeeper/ Cloning into 'c/Dev/GIT/mysite-etckeeper'... remote: Counting objects: 1400, done. re

我收到警告:当使用git clone时,以下路径发生冲突,例如,不区分大小写文件系统上的区分大小写路径,并且只有来自同一冲突组的一个路径位于工作树错误中:

git clone -c core.symlinks=true ssh://root@11.22.33.44/etc c/Dev/GIT/mysite-etckeeper/
Cloning into 'c/Dev/GIT/mysite-etckeeper'...
remote: Counting objects: 1400, done.
remote: Compressing objects: 100% (1202/1202), done.
remote: Total 1400 (delta 195), reused 0 (delta 0)
Receiving objects: 100% (1400/1400), 3.71 MiB | 276.00 KiB/s, done.
Resolving deltas: 100% (195/195), done.
Checking out files: 100% (1154/1154), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'HOSTNAME'
  'hostname'


/etc # ls -la HOSTNAME
lrwxrwxrwx   1 root root         8 Mar 29  2017 HOSTNAME -> hostname

/etc # ls -la hostname
-rw-r--r--   1 root root        18 Dec 21  2016 hostname
我如何解决这个问题? 此符号链接问题也会导致其他问题

例如: 以下是重现错误的回购示例:

执行以下命令:

$ git clone -c core.symlinks=true https://github.com/klorinczi/test_dupe_filename 
Cloning into 'test_dupe_filename_example'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 9 (delta 0), reused 9 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'HOSTNAME'
  'hostname'

您所在的系统具有不区分大小写的文件系统,并且存储库包含两个仅在大小写主机名和主机名方面不同的文件。无法同时在系统上表示这两个文件,因此只签出一个文件。请注意,这与您使用符号链接无关

您有一些选择:

您可以要求该存储库的维护人员删除其中一个重复文件,并将其重命名; 如果您使用的是Windows 10,您可以在使用Git init创建Git存储库后创建它,然后在现有存储库中使用Git fetch来提取数据,而不是克隆数据; 你可以像现在这样继续生活;或 您可以在VM中使用不同的操作系统,如Linux。 如果要选择第二个选项,请执行以下操作:

git init mysite-etckeeper
# Steps to make mysite-etckeeper case-sensitive from link above.
cd mysite-etckeeper
git remote add origin ssh://root@11.22.33.44/etc
git fetch origin
git reset --hard origin/master

自1803年以来,在Windows 10上,您可以使目录+子目录区分大小写。或者安装并使用Microsoft提供的Windows子系统for Linux WSL。它提供了一个Linux shell环境,使用您当前的硬盘文件系统,区分大小写。在那里你可以安装和使用git。这个问题有一个有趣的变体:它也发生在名为filename和filename.exe的两个文件上