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

【字号: 日期:2023-08-23浏览:37作者:雯心

问题描述

操作步骤是这样的 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. 求大家帮忙

问题解答

回答1:

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

回答2:

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

回答3:

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

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

相关文章: