此问题已在此处有答案:
Message "Support for password authentication was removed. Please use a personal access token instead."(48回答)
4天前关闭。
我需要将一个克隆的repo推送回Github,但是当我在初始化并添加远程源的文件夹中运行git push -u -f 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/BusyBird15/WeatherOne.git/'
当主身份验证方法已被删除时,我如何进行身份验证?
1条答案
按热度按时间sdnqo3pr1#
GitHub的主要身份验证方法是SSH,你可以在他们的文档中阅读:https://docs.github.com/en/authentication/connecting-to-github-with-ssh
作为总结,部分摘自GitHub自己的文档,你应该:
1.生成一个SSH密钥,使用如下命令:
ssh-keygen -t ed25519 -C "your_email@example.com"
1.如果使用linux,请使用
chmod 600 keyFile
修改密钥文件的权限1.将密钥添加到您的GitHub配置文件中,在Settings -> SSH keys下
1.使用
ssh-add ~/.ssh/id_ed25519
将密钥添加到git安装中然后,您必须调整您的源以指向存储库的ssh端点。你链接的是:
git@github.com:BusyBird15/WeatherOne.git