0

(最初是在 Git 邮件列表Git For Windows 邮件列表上询问的,到目前为止没有任何回应。)

问题

在运行命令时,我注意到子模块初始化期间命令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 配置文件有什么问题吗?

4

1 回答 1

1

TL;TR:这是 Git 中的一个错误,已在 2.21 中修复。

我收到了对我在 Git 邮件列表上的原始帖子的回复:

当然,我们在即将发布的 2.21 版本中修复了一堆 getenv() 问题,包括 8aac69038f (get_super_prefix(): copy getenv() result, 2019-01-11)。

我已验证 git 版本 2.21.0.rc2.windows.1 中不再出现该问题

于 2019-02-21T10:56:31.410 回答