简体   繁体   English

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

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

I entered this command on Git Bash Terminal on Windows and I got this:我在 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)

Kindly help me what should I do?请帮助我该怎么办? I searched here and on the internet but most of them are for the working directory or the home directory.我在这里和互联网上搜索过,但大多数都是针对工作目录或主目录的。 If I can get to know how to change the documentation directory, it will be very much helpful.如果我能了解如何更改文档目录,那将非常有帮助。 I have recently started programming.我最近开始编程。

Thank you for your time and efforts.感谢您的时间和努力。

It's basically trying to tell you that the documentation isn't installed where it thought it would be.它基本上是想告诉您文档没有安装在它认为的位置。

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

If you have the HTML documentation files installed locally in C:\whatever , try如果您在C:\whatever中本地安装了 HTML 文档文件,请尝试

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

This will be better handled with Git 2.34 (Q4 2021), where the error in " git help no-such-git-command " ( man ) is handled better.使用 Git 2.34(2021 年第四季度)可以更好地处理此问题,其中“ git help no-such-git-commandman中的错误得到了更好的处理。

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

help : make sure local html page exists before calling external processes help : 在调用外部进程之前确保本地 html 页面存在

Signed-off-by: Matthias Aßhauer签字人:Matthias Aßhauer

We check that git.html exists, regardless of the page the user wants to open.无论用户想要打开哪个页面,我们都会检查git.html存在。
Checking whether the requested page exists instead gives us a smoother user experience in two use cases:相反,检查请求的页面是否存在可以在两个用例中为我们提供更流畅的用户体验:

  1. The requested page doesn't exist请求的页面不存在

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 browser (or a helper program like xdg-open or start that should in turn open a browser) without any error and many GUI based browsers or helpers won't output such a message onto the standard error stream. 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 上。

Especially the helper programs tend to show the corresponding error message in a message box and wait for user input before exiting.尤其是帮助程序往往会在消息框中显示相应的错误消息,并在退出之前等待用户输入。
This leaves users in interactive console sessions without an error message in their console, without a console prompt and without the help page they expected.这使用户在交互式控制台会话中没有错误消息,没有控制台提示,也没有他们期望的帮助页面。

  1. git.html is missing for some reason, but the user asked for some other page git.html由于某种原因丢失,但用户要求提供其他页面

We currently refuse to show any local html help page when we can't find git.html .当我们找不到git.html时,我们目前拒绝显示任何本地 html 帮助页面。
Even if the requested help page exists.即使请求的帮助页面存在。
If we check for the requested page instead, we can show the user all available pages and only error out on those that don't exist.如果我们改为检查请求的页面,我们可以向用户显示所有可用的页面,并且只在那些不存在的页面上出错。

So no more:所以不再:

xxx not a documentation directory

Rather:相当:

'yyy.html': documentation file not found

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

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