为什么vscode会在终端上截获git push命令? [英] why does vscode intercepts git push command on terminal?

查看:75
本文介绍了为什么vscode会在终端上截获git push命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我要从 vscode终端执行 git push ,并弹出一个对话框,提示:

Today I was going to execute git push from the vscode terminal and a dialog popup saying:

扩展名"GitHub"要使用GitHub登录.

extension 'GitHub' wants to sign in using GitHub.

我已经检查并发现我在vscode上没有安装任何名为GitHub的扩展.

I've checked and turns out that I don't have any extension called GitHub installed on vscode.

问题是为什么这对我显示?如果我想使用扩展名进行推送,则不会在终端 git push 上键入内容.vscode会拦截我在终端中键入的内容吗?

The question is why this is showing for me? If I wanted to push using an extension I would not typing on terminal git push. Is vscode intercepting what I type in terminal?

此外,它还会打开一个用户/密码对话框,如下所示:

Besides that it also opens a user/password dialog like this:

这是侵入性的.有什么方法可以禁用此功能吗?

This is invasive. Is there any way to disable this?

PS:我已经从设置中取消选中GitHub身份验证:

PS: I already uncheck GitHub Authentication from Settings:

我使用vscode一年了,这是使我烦恼的第一件事.我非常喜欢vscode,但我不希望它成为IDE.这样的功能应通过扩展来增加.

I'm using vscode for one year and this is the first thing that annoyed me. I like vscode very much and I don't want it to became an IDE. Features like this should be incremented by extentions.

PS2:我正在使用vscode 1.50.0

PS2: I'm using vscode 1.50.0

推荐答案

此行为是内置的VS Code ,因此即使您没有安装GitHub扩展,您也会看到此提示:

This behaviour is built into VS Code, so you will see this prompt even if you do not have a GitHub extension installed:

当您运行任何Git时,都会通过GitHub启用身份验证要求GitHub身份验证的VS Code中的操作,例如推送到您所属的存储库或克隆私有存储库资料库.您不需要安装任何特殊扩展用于身份验证;它内置于VS Code中,因此您可以有效地管理您的存储库.当您执行需要GitHub身份验证的操作时,您会看到提示登录

Enabling authentication through GitHub happens when you run any Git action in VS Code that requires GitHub authentication, such as pushing to a repository that you're a member of or cloning a private repository. You don't need to have any special extensions installed for authentication; it is built into VS Code so that you can efficiently manage your repository. When you do something that requires GitHub authentication, you'll see a prompt to sign in

您可以使用单独的Windows命令提示符来避免VS Code拦截您的命令.

You can use a separate Windows command prompt to avoid VS Code intercepting your commands.

编辑如果您更喜欢将VS Code终端用于不带拦截功能的git命令,那么正如HolyBlackCat指出的那样,现在有一个禁用此行为的设置.

EDIT If you prefer to use VS Code terminal for git commands without the interception, then as HolyBlackCat helpfully points out, there is now a setting to disable this behaviour.

"github.gitAuthentication": false,

然后,任何git身份验证提示都将在VS Code之外发生.

Any git authentication prompts will then occur outside VS Code.

这篇关于为什么vscode会在终端上截获git push命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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