我一直在嘗試使用從我的 shell 終端生成的個人訪問令牌推送到 gh。在我發送垃圾郵件后它只作業了一次,git --set-upstream origin push master但它不再推動提交。我仍然可以克隆存盤庫。
我還編輯了 git 組態檔,但它一直要求輸入密碼。每當我使用令牌時,它都會引發此錯誤:
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/kurosakiaduma/alx-pre_course.git/'
這是我的遙控器:
origin https://kurosakiaduma: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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@github.com/kurosakiaduma/alx-pre_course.git (fetch)
origin https://kurosakiaduma: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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@github.com/kurosakiaduma/alx-pre_course.git (push)
我哪里錯了?
uj5u.com熱心網友回復:
首先檢查您的git config --global credential.helper價值。
如果是xxx(如“manager”或“manager-core”),請檢查為 github.com 存盤的內容
printf "host=github.com\nprotocol=https" | git credential-xxx get
printf "host=github.com\nprotocol=https\nusername=kurosakiaduma" | git credential-xxx get
(替換xxx為回傳的值git config --global credential.helper)
這樣,您將知道密碼(而不是令牌)是否存盤/快取在憑證助手中。
如果存盤了錯誤的值,您可以使用以下命令覆寫它:
printf "host=github.com\nprotocol=https\nusername=kurosakiaduma\npassword=ghp_yourToken" | git credential-xxx store
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/490906.html
