git 有一次在家里修改后配置了ssh,然后回到公司再使用git就使用不了了

操作步骤是这样的 
1, git add . 
2. git commit -m 'modify' 
3. git fetch origin 


这一步报这个错 
$ git fetch origin 
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. 

求大家帮忙
阅读 4k
5 个回答

把本机的ssh公钥添加在git库上面啊.

一步到位的方法,重新生成公钥,然后更换公钥

两种可能:
1.公司网络禁用了SSH的22端口
2.公司机器的SSH key 没有添加

解决方案:
1.改用https协议 或 改用443端口
2.添加公钥

这是被墙了吧. 多试几次.

端口被屏蔽了,它只是说链接超时而不是权限不足

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进