首页 > 解决方案 > 可以提交到github

问题描述

我准备了一个项目,并想提交给 Github。A 也有 Git + GitHub 桌面并在其中使用 VSCode 和终端。因此,当我尝试从项目文件夹中的 VSCode 中的终端检查“git”时,我遇到了问题:

git : 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.
At line:1 char:1
+ git
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

使用普通cmd时一切正常!我该如何解决?

标签: git

解决方案


这是因为你的git可执行文件 ( git.exe) 目录没有在PATH变量中设置,所以 PowerShell 无法找到它。

您需要找到安装 git 的文件夹并PATH使用 Windows 的环境变量编辑器将其添加。

请参阅此答案中的详细说明。


推荐阅读