问题
Error when trying git command in cmd:
The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I need this to work in the integrated terminal on VSC!
Edit: I've already tried editing the path variables and the settings in VSC. Nothing works.
回答1:
"Not recognized" is normally the way terminals politely tell you they don't know what you typed means.
If you can use git from a command line, then it's installed properly. You can use where git or which git depending on your command line to find the path of the functioning git. (if those don't work, please specify your terminal type in the question).
Once done, open VS Code, hit ctrl + , to open settings and type git path in the search. Add this path, and you should be able to use git in VS Code.
来源:https://stackoverflow.com/questions/58189196/git-commands-in-vsc-terminal-not-working-yet-they-work-on-cmd-prompt