重庆可做网站 APP,文化网站建设论文,帝国做的网站怎么上传图片,南阳住房和城乡建设管理局网站Github项目无法通过 ssh 连接#xff0c;以前正常使用的#xff0c;现在无法 push pull
一、问题描述
2024-01-18 这两天遇到一个问题#xff0c;就是以前正常使用的项目#xff0c;现在无法 push 或 pull 了。 我所有的项目都是以 gitgithub.com:KyleBing/xxxx.git 的方…Github项目无法通过 ssh 连接以前正常使用的现在无法 push pull
一、问题描述
2024-01-18 这两天遇到一个问题就是以前正常使用的项目现在无法 push 或 pull 了。 我所有的项目都是以 gitgithub.com:KyleBing/xxxx.git 的方式使用的不想改成 https:// 。
错误提示是这样的
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.二、解决
我将以前那种方式
git clone gitgithub.com:KyleBing/iphone.git iphone-vue改成
git clone ssh://gitssh.github.com:443/KyleBing/iphone.git iphone-vue是可行的。
但其实有更方便的方法。
只需要在 ~/.ssh/config 中添加以下配置以前的项目就都能正常使用了。
Host github.comHostname ssh.github.comPort 443User git官方说明文档 https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port # 以这种方式使用是可以的但不方便。
KyleKyles-mbp tools % git clone ssh://gitssh.github.com:443/KyleBing/iphone.git iphone-vue
Cloning into iphone-vue...
remote: Enumerating objects: 1483, done.
remote: Counting objects: 100% (224/224), done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 1483 (delta 148), reused 141 (delta 72), pack-reused 1259
Receiving objects: 100% (1483/1483), 6.00 MiB | 2.79 MiB/s, done.
Resolving deltas: 100% (936/936), done.# 其实只需要添加关于 github 的 ssh 配置
KyleKyles-mbp tools % vi ~/.ssh/config# 就能测试验证成功
KyleKyles-mbp tools % ssh -T gitgithub.com
Hi KyleBing! Youve successfully authenticated, but GitHub does not provide shell access.# 之前的项目也能正常使用了。