joa*_*kim 22 visual-studio-code
我正试图从VSCode向我的Github存储库推送,拉取任何东西.
我输入了我的用户名和密码,但我收到的错误是Authentication failed on the git remote.
我刚刚使用相同的用户/通行证登录github.com.
我尝试创建个人访问令牌,使用它作为密码,同样的错误.
ale*_*jjj 87
我相信我已经找到了解决这个问题的方法。上述解决方案都不适合我。我认为这个问题的根本原因是GitHub已于2021年8月13日结束了对密码身份验证的支持。而是需要使用个人访问令牌。
解决该问题的步骤如下:
git remote set-url origin https://<TOKEN>@github.com/<user_name or organization_name>/<repo_name>.git
Run Code Online (Sandbox Code Playgroud)
如果您想遵循视频指南,这个视频会非常有帮助。
joa*_*kim 33
通过在Git中缓存GitHub密码来解决它.
步骤如下:
git config --global credential.helper wincred
在 GitHub 于 2021 年 8 月 13 日更改其政策以使用个人访问令牌 (PAT) 而不是密码进行身份验证后,我就遇到了这种情况。
\n我为自己做了这些步骤。我使用的是Lubuntu 20.04。
\n在我的主目录中创建.gitconfig
并添加以下内容
[user]\n name = {your github username}\n email = {your email}\n[credential]\n helper = store --file ~/.git-credentials\n
Run Code Online (Sandbox Code Playgroud)\n在我的主目录中创建,.git-credentials
如上所示,并添加以下内容
https://{your github username}:{your github PAT}@github.com\n
Run Code Online (Sandbox Code Playgroud)\n最后一步:重新启动终端并瞧\xc3\xa0!尝试在现有的 Visual Studio Code Git 文件夹中提交/推/拉,一切都会像以前一样工作。
\n您的个人访问令牌 (PAT) 将以清晰的 ASCII 文本形式公开,如果任何人有权访问您的用户帐户,则可以读取。
\n 归档时间: |
|
查看次数: |
19562 次 |
最近记录: |