gpt4 book ai didi

Git 无法在内部处理 LOG

转载 作者:太空狗 更新时间:2023-10-29 14:13:21 24 4
gpt4 key购买 nike

我不小心输入了大写的 Git 命令并得到了这个错误:

❯ git LOG
fatal: cannot handle LOG internally

它发生在其他有效的命令中:

fatal: cannot handle COMMIT internally
fatal: cannot handle ADD internally

等等。

但是,完全无效的命令会产生更熟悉的错误消息:

❯ git nonsense
git: 'nonsense' is not a git command. See 'git --help'.

❯ git NONSENSE
git: 'NONSENSE' is not a git command. See 'git --help'.

这些情况有什么区别,第一个错误有什么意义吗?

我在 OSX Mavericks 上使用 Git 1.8:

❯ git --version
git version 1.8.5.2 (Apple Git-48)

最佳答案

原因可以在标记为v1.8.5.2(您拥有的版本)的git源代码中找到in file git.c

它将LOG识别为内部命令名,但随后无法处理它,因为在命令查找表中只有小写的log

简而言之 - 不同的消息是由不同的代码路径引起的,这只是一个错误 - 没有重大意义。

这在后来的版本中也被重写了 - compare it to current version in master branch here.

关于Git 无法在内部处理 LOG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25872016/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com