remote: Support for password authentication was removed on August 13, 2021. Please use a personal...

周末提交代碼,把代碼push到github上,控制臺(tái)報(bào)了下面的錯(cuò)誤:

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

表示遠(yuǎn)程推送不再支持密碼驗(yàn)證了,改成 token 驗(yàn)證了。

解決方案

  1. 首先要生成token,在 github 上找到setting -> Developer settings ->Personal access tokens->Generate new token
    找到生成token路徑

在配置頁面配置好權(quán)限后,即可生成token,注意這里需要保存好token,因?yàn)橹伙@示一次

  1. 設(shè)置token,這里分成兩種情況,代碼已經(jīng)有的,遠(yuǎn)程倉庫地址添加token;沒有代碼的,在git clone添加token
  • 修改遠(yuǎn)程倉庫添加token
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
  • git clone 添加token
git clone https://<your_token>@github.com/<USERNAME>/<REPO>.git

添加好token就可以推送和下拉代碼了。

遇到的坑

  1. 在idea上的github上設(shè)置token沒效果,這個(gè)具體原因未知
  2. 網(wǎng)上一大堆介紹如果生成token,但是重點(diǎn)是第二步,添加或者更新token。
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容