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