在Windows上使用符号链接克隆存储库时会发生什么? [英] What happens when I clone a repository with symlinks on Windows?
问题描述
在Windows上添加对符号链接的支持方面存在很多问题。但是,当我在Windows上克隆符号链接库时实际发生了什么?
由于 version 1.5.3 由于 com / git-for-windows / git / releases / tag / v2.10.2.windows.1rel =noreferrer> Git for Windows version 2.10.2 安装程序有启用符号链接支持的明确选项。 在Git for Windows的旧版本中,您可以手动将 更多详细信息可在Git for Windows wiki中找到。 在旧版Git for Windows中手动将 请注意,JGit客户端在目标文件系统的版本中没有探测到目标文件系统的符号链接支持3.3,所以 您可以结帐 https://github.com/sschuberth/git-playground ,其中包含一些在Linux上创建的用于测试的链接。 There's been a lot of questions about adding support for symlinks on Windows. But, what actually happens when I clone a repository with symlinks on Windows? Since version 1.5.3 of the native Git client Since Git for Windows version 2.10.2 the installer has an explicit option to enable symbolic link support. In older versions of Git for Windows you can manually set More details are available in the Git for Windows wiki. In older versions of Git for Windows manually setting As a side note, the JGit client did not probe the target file system for symlink support until its version 3.3, so the You can checkout https://github.com/sschuberth/git-playground which contains a bunch of links created on Linux for testing. 这篇关于在Windows上使用符号链接克隆存储库时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! git clone
和 git init
将探测目标文件系统的符号链接支持,并相应地为 core.symlinks
设置本地存储库配置,即
core.symlinks
设置为 true
,以便Git创建符号链接在以下限制条件下:
SeCreateSymbolicLinkPrivil ege
权限
core.symlinks
手动设置为 true $克隆并重置你的工作树后,你会得到类似于
$ git reset --hard HEAD的错误信息
错误:无法创建符号链接目录(函数未执行)
错误:无法创建符号链接linux-links / this_is_a_symbolic_link_to_file(函数未实现)
致命:无法将索引文件重置为修订版'头'。
core.symlinks
设置回落到系统/全局Git配置。从 3.3版开始 JGit探讨符号链接支持,但似乎太保守,设置 core.symlinks = false
某些情况下其中符号链接实际上将受支持。
git clone
and git init
will probe the target file system for symlink support and set the local repository configuration for core.symlinks
accordingly, i.e. to false
for FAT or NTFS. This makes symlinks created and committed e.g. under Linux appear as plain text files that contain the link text under Windows (see the git config documentation on core.symlinks for details).core.symlinks
to true
which enabled Git to create symbolic links under the following constraints:
SeCreateSymbolicLinkPrivilege
privilege.core.symlinks
manually to true
after cloning and reset your working tree, you would get error messages similar to$ git reset --hard HEAD
error: unable to create symlink directory (Function not implemented)
error: unable to create symlink linux-links/this_is_a_symbolic_link_to_file (Function not implemented)
fatal: Could not reset index file to revision 'HEAD'.
core.symlinks
setting was falling back to whatever the system / global Git configuration was. Starting with version 3.3 JGit probes for symlink support but seems to be too conservative, setting core.symlinks = false
in some cases where symlinks would be in fact supported.