[英]Error running git submodule commands outside git-bash on Windows
我正在处理一个带有 git 子模块的项目,有时需要运行git submodule init
和git submodule update
类的命令。 我正在为 Windows 2.35.2 运行 Git。
问题是这些非常具体的命令在 git-bash 之外的任何环境中都不起作用(其他命令运行良好)。 当我在 Windows CMD 甚至 VsCode 中的 git-bash 终端上运行它们时,我得到了下面的错误。
$ git submodule update
Stack trace:
Frame Function Args
000FFFF9FB0 00180062CB7 (000FFFFA1B8, 00000000002, 00000000002, 000FFFFDE50)
...
000FFFFFFF0 001800477C4 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
/mingw64/libexec/git-core/git-sh-setup: line 46: /git-sh-i18n: No such file or directory
我尝试了一些明显的解决方案,例如添加 git 路径或在管理模式下运行 CMD 或 VsCode,但没有任何效果。 问题是错误中提到的脚本行应该获得git-sh-i18n
的路径:
. "$(git --exec-path)/git-sh-i18n"
当我在 CMD 上运行此行时,它本身会返回正确的路径:
git --exec-path
C:/Program Files/Git/mingw64/libexec/git-core
所以,它应该在git-sh-setup
脚本中工作,但没有。
有没有人有同样的问题并有任何提示?
显然,在Windows 的 Git 的较新版本上,此问题不再发生。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.