2

I'm going through these tutorials to become familiar with Git. One example is using git help <command name>

but this does not work for me, all I get is the following:

$ git help fetch
/usr/bin/start: line 8: : command not found

I am expecting this to open up a web page with the required information? Other help commands such as git help -a does work.

I have added system32 to the PATH as others suggested, but to no avail:

enter image description here

Git version with Windows 10:

$ git --version
git version 2.37.2.windows.2

Any help or pointers would be appreciated.

ChrisD91
  • 249
  • 3
  • 10
  • Did you reboot your computer? Because that's when all the system variables are loaded iirc – Lukas Hein Aug 22 '22 at 10:52
  • 1
    yes, I made sure to reboot my system once changing the system variables – ChrisD91 Aug 22 '22 at 10:58
  • Not sure if this helps you, but when I type `git help fetch` this local file is opened in a browser: `file:///C:/Program%20Files/Git/mingw64/share/doc/git-doc/git-fetch.html` – TTT Aug 22 '22 at 14:27

1 Answers1

2

When you run git help fetch, Git runs a help-assistant program. That's why you see this:

$ git help fetch
/usr/bin/start: line 8: : command not found

In your case, the help-assistant program is /usr/bin/start, which appears to be a shell script. Line 8 of this shell script attempts to run some command—what command is intended here, I don't know—probably as a result of a shell variable expansion, when the shell variable itself is empty.

If you inspect /usr/bin/start you'll be able to see what it is attempting to do. The overall goal here is usually to start a browser over the installed Git documentation; see How to change the browser for accessing git help pages? (and, somewhat related, "cmd: command not found" from "start" command (open directory in Windows Explorer) in git bash?). It's likely that you can set a configuration or environment variable that will make this all work.

See also this superuser.com question.

torek
  • 448,244
  • 59
  • 642
  • 775
  • Hi, thanks for the direction. I followed the path and found the start file. Line 8 is "$COMSPEC" //c start "${@//&/^&}" and it is this that it can't find. It is strange to me that following the GIT installation manager for Windows has resulted in this problem when typically no other Windows users have it when following the default installation. – ChrisD91 Aug 23 '22 at 07:05
  • `$COMSPEC` must be empty here: that would cause the problem. What is `$COMSPEC` supposed to be set to? https://www.google.com/search?q=comspec+environment+variable turns up some clues, including [this SO question](https://stackoverflow.com/q/2276483/1256452). – torek Aug 23 '22 at 20:39