我的 GitHub 個人訪問令牌已過期,我真的不知道如何在命令列上更新個人訪問令牌。
git push
Password for 'https://[email protected]':
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/myuser/myrepor.git/'
任何幫助將不勝感激,因為我很困惑
uj5u.com熱心網友回復:
您不應將令牌保存在 URL 中。這是不安全的,因為任何可以讀取組態檔的人都可以看到您的憑據。在Git的常見問題解釋了如何設定和使用憑證幫手。
要從您的 URL 中洗掉令牌,請執行以下操作:
$ git remote set-url origin https://github.com/myuser/myrepor.git
然后,在設定您的憑證助手后,當您推送時,Git 會提示您輸入憑證。出現提示時輸入您的用戶名,并在提示輸入密碼時提供令牌。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/389530.html
