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

查看:47
本文介绍了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天全站免登陆