问题
Cloning into 'xxx'...
Username for 'https://github.com': xx.xx@qq.com
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/xx/xx.git/'
解决方法
本地生成私钥
ssh-keygen -t rsa -C "xx.xx@qq.com"
xx.xx@qq.com表示自己的github邮箱
执行该后一直输入回车就可以了。
在github中增加私钥
在github中点击设置
点击SSH and GPG Keys
New SSH Keys
私钥位置
一般在C:\Users\admin.ssh下面,有一个id_rsa.pub文件,将id_rsa.pub文件中的内容全部输入到key中
然后选择对应的项目选择ssh方式
成功截图
admin@????? MINGW64 /e/study_java $ git clone git@github.com:xxx/xxx.git Cloning into 'xxx'... The authenticity of host 'github.com (20.205.243.166)' can't be established. ECDSA key fingerprint is SHA256:xxxxx/xx/LiyKgUfQM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts. remote: Enumerating objects: 323, done. remote: Counting objects: 100% (323/323), done. remote: Compressing objects: 100% (177/177), done. remote: Total 323 (delta 140), reused 277 (delta 96), pack-reused 0 Receiving objects: 100% (323/323), 68.64 KiB | 23.00 KiB/s, done. Resolving deltas: 100% (140/140), done.
学习java群
java交流群:868794080