(最初问的是https://public-inbox.org/git/CABUeae_N3NFXn-E1+LHORL3RDf5iTCFn=zyuOo3c2Aot2QF7pg@mail.gmail.com/和https://groups.google.com/d/msg/git-for-windows/XqrfaEQpd1E/mJyXuxO-BAAJ,到目前为止没有任何回应。)
问题
在运行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路径中。
(所有文件都是可在GitHub上获得)。
问题
有人能解释为什么git在其输出中随机插入别名的定义吗?
我的Git配置文件有什么问题吗?
发布于 2019-02-21 10:56:31
TL;TR:它是Git中的一个bug,在2.21中修复。
我在Git邮件列表上收到了对我最初帖子的回复:
当然,我们修复了即将发布的2.21版本中的getenv()问题,包括8aac69038f (get_super_prefix():copy ()结果,2019-01-11)。
我已经证实这个问题不再出现在git版本2.21.0.rc2.windows.1中。
https://stackoverflow.com/questions/54794496
复制相似问题