git 我无法推送到存储库,收到错误消息“Support for password authentication was removed”(已删除对密码身份验证的支持),但我生成了经典令牌

eqqqjvef  于 2023-01-01  发布在  Git
关注(0)|答案(1)|浏览(100)

我在这里回顾了这个答案:Message "Support for password authentication was removed. Please use a personal access token instead."
但我还是会出错

PS C:\Js Projects> git push -u origin main
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/zac/FindCommonItems.git/'

我生成了一个具有所有权限的经典令牌,并在Windows 11凭据管理器中进行了如下设置

运行时在VS代码中

git push -u origin main

我得到了上面相同的错误。我错过了什么?

fcy6dtqo

fcy6dtqo1#

工作感谢@273K这样:

Deleted .git folder
git remote set-url origin git@github.com:zac/FindCommonItems.git
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/zac/FindCommonItems.git
git push -u origin main

它还提示从浏览器进行身份验证

相关问题