我发现git clone
默认将本地core.symlinks
值设置为false
,即使将core.symlinks
设置为true
。
> git config --list --show-origin
file:"C:\\ProgramData/Git/config" core.symlinks=true
file:"C:\\ProgramData/Git/config" core.autocrlf=input
file:"C:\\ProgramData/Git/config" core.fscache=true
file:"C:\\ProgramData/Git/config" color.diff=auto
file:"C:\\ProgramData/Git/config" color.status=auto
file:"C:\\ProgramData/Git/config" color.branch=auto
file:"C:\\ProgramData/Git/config" color.interactive=true
file:"C:\\ProgramData/Git/config" help.format=html
file:"C:\\ProgramData/Git/config" rebase.autosquash=true
-- snip --
> cat .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/saschanaz/eslint-plugin-import
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
这一切为什么要发生?
发布于 2019-10-28 07:34:38
这是因为我没有启用开发模式,因此git无法在没有管理权限的情况下创建符号链接。使其能够使未来的克隆人获得适当的符号链接。
发布于 2019-10-28 11:14:34
遗憾的是,core.symlinks
在Git中超载。
如果在创建存储库时将core.symlinks
设置为true
(无论是运行git init
还是git clone
),则git实际上将尝试检测所创建的工作目录中是否支持符号链接,如果支持,则会将存储库的core.symlinks
设置为true。
如果不支持它们(例如,您没有启用开发人员模式),那么存储库的core.symlinks
配置选项将被设置为false
。
因此,第一个选项作为一种机制,您可以指定是否需要符号链接。第二个操作类似于平台上是否支持符号链接的缓存,这样它就不需要在每次操作中都检测到这一点(就像core.ignorecase
一样)。
https://stackoverflow.com/questions/58587005
复制相似问题