(最初询问on Git mailing list和on Git For Windows mailing list,到目前为止没有任何回应。)
在运行git clone --recurse-submodules https://repo
命令时,我注意到子模块初始化期间git
命令的奇怪输出:
Submodule 'Binary/A' (https://repo) registered for path '!f() { ~/AppData/Local/Fork/Fork.exe $PWD; }; fBinary/A'
Submodule 'Binary/B' (https://repo) registered for path '!sh -c 'git log $1@{1}..$1@{0} $@'Binary/B'
Submodule 'Binary/C' (https://repo) registered for path 'ls-files -o -i --exclude-standardBinary/C'
Submodule 'Binary/D' (https://repo) registered for path 'mergetool.TortoiseGitMerge.trustexitcodeBinary/D'
该命令似乎运行良好并且成功完成。
我设法确定了注入到子模块打印路径中的垃圾是什么。它来自我已经配置的git别名,例如,在~/.gitconfig
中包括:
[include]
path = ~/alias_misc.gitconfig
并且在~/alias_misc.gitconfig
中有此别名
[alias]
fapp = "!f() { ~/AppData/Local/Fork/Fork.exe $PWD; }; f"
插入到上面复制的Binary/A
输出中的git clone
路径中。
(所有文件均为available on GitHub)。
有人能解释为什么git
在其输出中随机插入别名的定义吗?
我的Git配置文件有什么问题吗?
答案 0 :(得分:0)
TL; TR:这是Git中的错误,已在2.21中修复。
我已经在Git邮件列表上收到response to my original post:
当然,我们在即将发布的2.21版本中修复了很多getenv()问题,包括8aac69038f(get_super_prefix():复制getenv()结果,2019-01-11)。
我已验证git版本2.21.0.rc2.windows.1不再出现此问题