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/aaromthon/wanda.git/'
解决办法:
进入git bash界面然后:
一、git config --global --list 验证邮箱与GitHub注册时输入的是否一致,如下:
$ git config --global --list user.email=14392***@qq.com user.name=14392***@qq.com http.sslverify=false
二、设置全局用户名和邮箱,如下:
$ git config --global user.name "username" $ git config --global user.email "14392***@qq.com"
三、ssh-keygen -t rsa -C “这里换上你的邮箱”,一路回车,在出现选择时输入Y,再一路回车直到生成密钥。会在/Users/***/路径下生成一个.ssh文件夹,密钥就存储在其中,如下:
$ ssh-keygen -t rsa -C "14392***@qq.com" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/Lenovo/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/Lenovo/.ssh/id_rsa Your public key has been saved in /c/Users/Lenovo/.ssh/id_rsa.pub The key fingerprint is: SHA256:cmghkaLRiF50CP*************** 14392***@qq.com The key's randomart image is: +---[RSA 3072]----+ |.**=*******o. | |=o+****Xo... | |+oEBEo=. | |.=+.o= o | |.. .+ A S | | .. o = | | . | | | | | +----[SHA256]-----+
四、复制 /c/Users/Lenovo/.ssh/id_rsa.pub 里面的内容到到git仓库,添加秘钥,如下:
五、ssh -T git@github.com 测试一下通不通,通了显示如下:
$ ssh -T git@github.com Hi aaro***! You've successfully authenticated, but GitHub does not provide shell access.
即可正常使用。
如果不通如下两步操作即可:
$ ssh-agent -s
$ ssh-add ~/.ssh/id_rsa
结束!