如以下命令所示,我已通过 ssh 成功连接到 github。
Admins-MacBook-Pro-4:.ssh bobsmith$ ssh -T [email protected]
Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
Hi bobsmith76! You've successfully authenticated, but GitHub does not provide shell access.
但是,当我 cd 到包含 .git 文件的文件夹并运行时
git push origin master
我明白了
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/bobsmith/git_learn.git/'
当我访问https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/时,我并没有看到任何关于我应该做什么的非常不稳定的事情。我确实看到了
将需要使用基于令牌的身份验证,例如个人访问令牌(适用于开发人员)或 OAuth 或 GitHub 应用程序安装令牌(适用于集成商),用于 GitHub.com 上所有经过身份验证的 Git 操作。您也可以在喜欢的地方继续使用 SSH 密钥。
但我以为我已经成功使用了 ssh 密钥。
您仍在尝试通过 推送https
,而不是ssh
尝试通过 进行身份验证https
。
ssh
从-repository 中的Code
-Button 中选择-Tab ,然后使用以下命令github
更改本地存储库的 url 。git
git remote set-url origin <git-url>
网址应如下所示:
[email protected]:<User>/<Repo>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句