繁体   English   中英

Git Bash 终端回复致命:“C:/....”:不是文档目录

[英]Git Bash Terminal replies fatal : "C:/....": not a documentation directory

我在 Windows 上的 Git Bash 终端上输入了这个命令,我得到了这个:

   Anurag Nihal@LAPTOP-DK8BSQJ5 MINGW64 ~/Desktop/first-project (master)
   $ find .git/objects -type f
   .git/objects/44/00aae52a27341314f423095846b1f215a7cf08
   .git/objects/b7/aec520dec0a7516c18eb4c68b64ae1eb9b5a5e
   (base)
   Anurag Nihal@LAPTOP-DK8BSQJ5 MINGW64 ~/Desktop/first-project (master)
   $ help git mktree
   bash: help: no help topics match `mktree'.  Try `help help' or `man -k 
   mktree' or `info mktree'.
   (base)
   Anurag Nihal@LAPTOP-DK8BSQJ5 MINGW64 ~/Desktop/first-project (master)
   $ git mktree --help
   fatal: 'C:/ProgramData/Anaconda3/Library/mingw64/share/doc/git-doc': not a 
   documentation directory.
   (base)
   Anurag Nihal@LAPTOP-DK8BSQJ5 MINGW64 ~/Desktop/first-project (master)
   $ echo $HOME
   /c/Users/Anurag Nihal
   (base)

请帮助我该怎么办? 我在这里和互联网上搜索过,但大多数都是针对工作目录或主目录的。 如果我能了解如何更改文档目录,那将非常有帮助。 我最近开始编程。

感谢您的时间和努力。

它基本上是想告诉您文档没有安装在它认为的位置。

你可以很容易地在网上找到它; https://git-scm.com/docs/git-mktree

如果您在C:\whatever中本地安装了 HTML 文档文件,请尝试

git config --global help.htmlPath C:\whatever

使用 Git 2.34(2021 年第四季度)可以更好地处理此问题,其中“ git help no-such-git-commandman中的错误得到了更好的处理。

请参阅Matthias Aßhauer ( rimrul )提交 a3952f8 (2021 年 9 月 14 日)。
(由Junio C Hamano -- gitster --提交 bd42622中合并,2021 年 9 月 23 日)

help : 在调用外部进程之前确保本地 html 页面存在

签字人:Matthias Aßhauer

无论用户想要打开哪个页面,我们都会检查git.html存在。
相反,检查请求的页面是否存在可以在两个用例中为我们提供更流畅的用户体验:

  1. 请求的页面不存在

When calling a git command and there is an error, most users reasonably expect git to produce an error message on the standard error stream, but in this case we pass the filepath to git web--browse ( man ) which passes it on to a浏览器(或像 xdg-open 或 start 这样的帮助程序应该反过来打开浏览器)没有任何错误,并且许多基于 GUI 的浏览器或帮助程序不会 output 这样的消息出现在标准错误 stream 上。

尤其是帮助程序往往会在消息框中显示相应的错误消息,并在退出之前等待用户输入。
这使用户在交互式控制台会话中没有错误消息,没有控制台提示,也没有他们期望的帮助页面。

  1. git.html由于某种原因丢失,但用户要求提供其他页面

当我们找不到git.html时,我们目前拒绝显示任何本地 html 帮助页面。
即使请求的帮助页面存在。
如果我们改为检查请求的页面,我们可以向用户显示所有可用的页面,并且只在那些不存在的页面上出错。

所以不再:

xxx not a documentation directory

相当:

'yyy.html': documentation file not found

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM