git - 可以提交到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.exe
) 目录没有在PATH
变量中设置,所以 PowerShell 无法找到它。
您需要找到安装 git 的文件夹并PATH
使用 Windows 的环境变量编辑器将其添加。
请参阅此答案中的详细说明。
推荐阅读
- android - 如何在android中使用文本编写这种类型的图标
- javascript - 尝试通过 laravel 中的 ajax 将数据发布到控制器时出现 MethodNotAllowedHttpException
- swift - 从 IBAction 函数中选择/推送到不同的视图控制器?
- react-native-navigation - 如何知道 sideMenu 可见性状态
- django - Django DateTimeField 不可编辑
- objective-c - 在 Objective-C 的另一个视图中检查 App Delegate 的切换状态
- angular - 当我想明确清除它时无法读取未定义的属性“viewContainerRef”
- mysql - 查询以四舍五入(例如:300.501 到 300.500)
- javascript - 我正在使用 pdf js 库通过 pdf 翻书库来表示 pdf 文件,但搜索在这里不起作用
- c# - 如何在分层模型中引用实例 - 当前上下文中不存在该名称