(最初问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配置文件有什么问题吗?
TL; TR:这是Git中的一个错误,修复于2.21。
我在Git邮件列表上收到了response to my original post:
当然我们在即将发布的2.21版本中修复了一堆getenv()问题,包括8aac69038f(get_super_prefix():copy getenv()result,2019-01-11)。
我已经验证了git版本2.21.0.rc2.windows.1中不再出现此问题