github push報錯:不再支持密碼


現象

$ git push
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 'xxxxx'

解決辦法

1.將本地id_rsa.pub 拷貝到 github 的 SSH keys 中
打開github,點擊右上角頭像,彈出列表,點擊“Settings”,點擊左側欄目上的“SSH and GPG keys”,再點擊“New SSH Key”,將本地~/.ssh/id_rsa.pub中的內容復制進去。

2.修改本地git的remote url
在代碼倉庫復制ssh地址,然后在本地執行:

git remote  set-url origin ssh地址


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM