git push origin master 提示輸入用戶名和密碼


今天更換了一台電腦,重新配置了SSH keys;但是在push得時候提示我輸入用戶名和密碼


taodeMacBook-Pro:my_trip_proj tao$ git push origin master
Username for 'https://github.com': 
Password for 'https://github.com': 

這就尷尬😅了撒

難道是我配置❌了?
於是我又重新執行$ ssh-keygen -t rsa -C "your email"命令生產ssh key;
然后在重新上傳,但是依然不行;why?

原來是我使用https來push得原因
在這里插入圖片描述
於是果斷干掉,改用ssh的方式


taodeMacBook-Pro:my_trip_proj tao$ git remote rm origin
taodeMacBook-Pro:my_trip_proj tao$ git remote -v

在GitHub對應的倉庫 點擊 User SSH 然后再復制地址,如下圖
在這里插入圖片描述
添加倉庫地址
在這里插入圖片描述
再次執行push就沒問題了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM