簡體   English   中英

github 不接受令牌

[英]github not accepting token

我正在嘗試將現有存儲庫推送到新的 GitHub 存儲庫。

為此,我必須生成一個令牌,我做到了,並將其復制到剪貼板上。

我的理解是,當我想推送到這個新的 repo 時,我需要將令牌粘貼到我用來輸入密碼的位置。 但是,這仍然會生成remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 錯誤。 我在這里不明白什么?

這是我的終端窗口顯示的內容:

$ git push -u origin main
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/me/expt_results.git/'

即使我在彈出窗口中輸入了我的用戶名並嘗試(多次)粘貼令牌和手動復制令牌來代替我的密碼。

我還嘗試執行以下操作:

git remote remove origin
git remote add origin https://[TOKEN]@github.com/[USER]/[REPO]
git push origin main

正如Authenticate with GitHub using a token 中所建議的那樣,但同樣沒有成功,盡管有不同的錯誤消息。

$ git push origin main
remote: Permission to [USER]/[REPO] denied to [USER].
fatal: unable to access 'https://github.com/[USER]/[REPO]/': The requested URL returned error: 403

我究竟做錯了什么???

您必須Select the scopes, or permissions要授予此token Select the scopes, or permissions 要使用您的令牌從命令行訪問存儲庫,請選擇 repo。 像這樣

https://docs.github.com/assets/images/help/settings/token_scopes.gif

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM