如以下命令所示,我已通過 ssh 成功連接到 github。
Admins-MacBook-Pro-4:.ssh bobsmith$ ssh -T [email protected]
Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
Hi bobsmith76! You've successfully authenticated, but GitHub does not provide shell access.
但是,當我 cd 到包含 .git 檔案的檔案夾并運行時
git push origin master
我明白了
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/bobsmith/git_learn.git/'
當我訪問 https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/時 ,我真的沒有看到任何關于我應該做的事情非常不穩定。我確實看到了
將需要使用基于令牌的身份驗證,例如個人訪問令牌(適用于開發人員)或 OAuth 或 GitHub 應用程式安裝令牌(適用于集成商),用于 GitHub.com 上所有經過身份驗證的 Git 操作。您也可以在您喜歡的地方繼續使用 SSH 密鑰。
但我以為我已經成功使用了 ssh 密鑰。
uj5u.com熱心網友回復:
您仍在嘗試通過 推送https,而不是ssh嘗試通過 進行身份驗證https。
ssh從-repository 中的Code-Button 中選擇-Tab ,然后使用以下命令github更改本地存盤庫的 url 。git
git remote set-url origin <git-url>
網址應如下所示:
[email protected]:<User>/<Repo>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/483502.html
標籤:混帐
