VSC终端中的git命令不起作用,但它们在cmd提示符下起作用 [英] git commands in VSC Terminal not working, yet they work on cmd prompt

查看:230
本文介绍了VSC终端中的git命令不起作用,但它们在cmd提示符下起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在cmd中尝试git命令时出错:

Error when trying git command in cmd:

术语"git"不能识别为cmdlet,函数,脚本文件或可运行程序的名称.检查名称的拼写,或者是否包含路径,请验证路径是否正确,然后重试.

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.

我需要它才能在VSC上的集成终端中工作!

I need this to work in the integrated terminal on VSC!

我已经尝试在VSC中编辑路径变量和设置.什么都行不通.

I've already tried editing the path variables and the settings in VSC. Nothing works.

推荐答案

不被识别"通常是终端礼貌地告诉您他们不知道您键入的意思的方式.

"Not recognized" is normally the way terminals politely tell you they don't know what you typed means.

如果可以从命令行使用git,则说明它已正确安装.您可以根据命令行使用where gitwhich git查找起作用的git的路径. (如果这些方法无效,请在问题中指定您的终端类型.)

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).

完成后,打开VS Code,点击ctrl + ,以打开设置,然后在搜索中键入git path.添加此路径,您应该可以在VS Code中使用git.

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.

这篇关于VSC终端中的git命令不起作用,但它们在cmd提示符下起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆