English 中文(简体)
为什么《视觉演播室法》没有承认Gite?
原标题:Why is Visual Studio Code not recognizing Git?

I m trying to upload my React app to my GitHub repository, but Visual Studio Code won t recognize a Git command.

我在《常设仲裁法院》上发言。 通往Gite的道路是正确的,我多次检查。 我通过《演播室视觉守则》终端安装了 包装.json所需的改动。 现在,在视觉演播室《行为守则》终端站,我操作git init时,它留下了一个错误,即“git”不是公认的指挥。 为什么会发生这种情况,我如何确定这种情况?

这是《演播室视觉守则》中“git.path”的基调:“C:Program 文件/Git/bin/git.exe”。 这是正确的。

Git Powered也接受检查。

File package.json edits under the first {} "homepage": "http://greardrear.github.io/messenger", is added and under scripts added "predeploy": "npm run build", "deploy": "gh-pages -d build", .

当我试图“ in”或“ remote边远添加来源”时,我在《视觉演播室法》终端站获得这一信息:

 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

我如何确定这一点?

PS。 我已经尝试了我可以发现的这一问题的所有“解决方案”。 我也试图改变“git.path”的道路:“C:Program files/Git/git-bash.exe”,后者也做了一些工作。

最佳回答

根据my 以前的答复,首先如果仅仅重新启动《常设仲裁法院》便会有所帮助。

PowerShell可能需要充分承认安装视窗的吉特。

https://stackoverflow.com/a/63750388/6309 视窗为。


请注意,我在“《视觉演播法》1.50(2020年9月)新特征:

支持<代码>git.path的多重价值 A. 安排

如果你使用视力演化器法,同时使用多台机器,而吉特则安装在上述机器上的不同道路上,这便会有所帮助。

不要忘记<代码>“git.enabled”:真实。

问题回答

第一,下载和安装最新版本 从下文中专门执行:

https://git-scm.com/download/win

然后,你们必须增加环境变量。 加入:

C:Program FilesGitin

C:Program FilesGitcmd

Click OK并关闭了您的终端。 现在该终点站再次开放,并检查你在座的指挥,即<代码>git ——。 (它给您安装的版本)。

For Visual Studio terminal window - the default shell is powershell. Now if your git-bash setup is working outside of VS Code using git-bash app, then you need to setup the VS code - terminal - default shell as git-bash.

这些步骤包括:

  1. In VS code, open the terminal window under the code section.
  2. You see tabs like OUTPUT, TERMINAL, GITLENS, DEBUG CONSOLE etc. On the extreme right you should see a "+" sign and that s a dropdown.
  3. When you drop down you will see multiple options - default is powershell, others are command prompt, git-bash, java-debug terminal etc. You can choose git-bash to resolve the issue shown here.




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签