来自 Visual Studio Code 的 Git 推送:“无匿名写入权限.认证失败" [英] Git push from Visual Studio Code: "No anonymous write access. Authentication failed"

查看:46
本文介绍了来自 Visual Studio Code 的 Git 推送:“无匿名写入权限.认证失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 GitHub 本身的教程.我正在关注教你使用 Visual Studio Code 工作的那个.

I was following a tutorial from GitHub itself. I am following the one that teaches you to work from Visual Studio Code.

我试图从 Visual Studio Code 推送一些东西,但在很长一段时间后我收到以下错误:

I was trying to push something from Visual Studio Code and after quite some time I get the following error:

remote: No anonymous write access.
fatal: Authentication failed for ....

现在我正在向我的个人帐户推送一些内容.我试着用谷歌搜索(但我又是新手,所以我不能完全理解所有的术语)我能找到的是 双因素身份验证(但在我的情况下是关闭的)和 Windows 凭据(但我检查过并且我的 Windows 凭据中没有任何 Git).

Now I am pushing something to my personal account. I tried to google (but again I am new to this so I don't fully understand all the terminology) and what I could find are issues with two-factor authentication (but that is off in my case) and Windows credentials (but I checked and I do not have any Git in my Windows credentials).

所以我不知所措.我还能尝试或检查什么?

So I am at a loss. What else I could try or check?

推荐答案

更简单的方法是使用 个人访问GitHub 上的代币.可以通过转到您的 GitHub 帐户来设置此功能 → 设置开发人员设置个人访问令牌生成个人访问令牌.进行访问控制选择,生成,然后复制并保存新令牌.之后,转到您的 Git 项目目录,然后在终端中输入:

A simpler method is to use personal access tokens at GitHub. This feature can be set up by going to your GitHub account → SettingsDeveloper settingsPersonal access tokensGenerate a personal access token. Make your access control selections, generate, then copy and save your new token. After this, go to your Git project directory and this enter in the terminal:

git remote set-url origin https://YOUR_TOKEN_HERE@github.com/your_user/your_project.git

从现在开始,您可以轻松地从终端或 Visual Studio Code 执行 git push.

From now on you can easily do git push from the terminal or Visual Studio Code.

这篇关于来自 Visual Studio Code 的 Git 推送:“无匿名写入权限.认证失败"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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