用pycharm向github庫push總是失敗?快使用ssh!


git bash:移動到項目目錄下

查看clone 地址:git remote -v

移除現有遠程庫方式:git remote rm origin

添加新的git方式:git remote add origin [github的ssh地址]

查看push方式是否修改成功:git remote -v

 push:git push origin master(或者使用pycharm的push)

 

 

# 問題: ssh: connect to host github.com port 22: Connection timed !

解決方法:

1、檢查SSH是否能連接成功:ssh -T git@github.com

2、vim config

3、輸入:

Host github.com

User 【YourEmail】

Hostname ssh.github.com

PreferredAuthentications publickey 

IdentityFile ~/.ssh/id_rsa

Port 443

4、:wq (保存退出)

5、ssh -T git@github.com(在彈出的提示后回車“yes”)

參考:https://blog.csdn.net/qq_42146613/article/details/82772734


免責聲明!

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



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