我想將我的分支推送到我的 github 帳戶上。我已經創建了 ssh 密鑰,所以我可以通過 ssh 連接:
rkukushkin@krv76-home:~/qtprojects$ ssh [email protected]
PTY allocation request failed on channel 0
Hi krv76! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
但是當我嘗試 git push 時,我得到了以下資訊:
rkukushkin@krv76-home:~/qtprojects$ git push origin master
Username for 'https://github.com': krv76
Password for 'https://[email protected]':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/krv76/signal.git/'
我希望連接而不檢查我的用戶名和密碼。
我忘記了什么或我做錯了什么?
uj5u.com熱心網友回復:
您需要將遠程 URL 設定為使用 ssh 協議,而不是 https 協議。
當您訪問 GitHub 時,“代碼”按鈕可讓您選擇協議:選擇“SSH”(從 gi??t-reference repo 任意獲取的快照):

當你克隆你的倉庫時,首先使用那個 URL。但是由于您已經使用 https 進行了克隆,因此您現在可以像這樣更改遠程 url(從錯誤日志中猜測您的 URL):
git remote set-url origin [email protected]:krv76/signal.git
uj5u.com熱心網友回復:
git remote -v將顯示托管您的代碼的存盤庫的 url,以便通過 ssh 連接到遠程您的 url 應該是
[email protected]:krv76/catboost.git
您可以git remote add用來添加新遠程或各種子命令的形式,git remote以使用您的本地克隆知道的遠程
https ://git-scm.com/docs/git-remote
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/515209.html
標籤:混帐githubSSH
上一篇:Recyclerview選擇位置邊框會出現,未選中邊框不出現-如何在AndroidStudio中進行設計,如高亮位置
