Domanda

I am new to Git and have been following the tutorials on the git-scm website I typed cmd into the input line in Git Bash and all the colours are gone and it looks like the normal command prompt. When I typed the input git status, it does return with the information.

However, when I start the normal command prompt and move to the working directory and type "git status", git is not recognized as a command.

My question is, what does the typing cmd in Git Bash actually do? If it turns the window into the normal command prompt, then why does typing git status in the normal command prompt not work?

(I have read the answer here, it would also be nice if someone explained what is happening in the steps of the top answer, if it is relevant to this question)

È stato utile?

Soluzione

When you run cmd in git bash, it actually calls the command prompt and triggers the Windows Command prompt, since the PATH variable contains the C:\Windows\System32 location set. If you type exit, the command prompt exits and you go back to git bash.

If typing git commands doesn't work in the Windows Command prompt then the path of git installation might not have been set in the PATH variable of Windows. Try adding the variable using this link

Remember git bash is the name of the prompt but not the actual exe. If you want to see actual git bash prompt through Command Prompt you will have run sh.exe --login -i.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top