之前都好好的,今天git push
突然出現(xiàn)這個問題
解決方法一:改用HTTP協(xié)議(我沒試過,應(yīng)該是可以的)文章來源:http://www.zghlxwxcb.cn/news/detail-807892.html
- 就是把遠程庫地址改成HTTP協(xié)議的,好像是這個命令,自己搜一下
git remote set-url origin https://username@github.com/username/repository.git
解決方法二:更改SSH端口(親測可用)文章來源地址http://www.zghlxwxcb.cn/news/detail-807892.html
- 先試試這個命令
ssh -T -p 443 git@ssh.github.com
- 此時出現(xiàn)如下提示信息
The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This host key is known by the following other names/addresses: ~/.ssh/known_hosts:1: github.com Are you sure you want to continue connecting (yes/no/[fingerprint])?
- 輸入
yes
,然后如果出現(xiàn)下面這個提示Hi 你的github用戶名
,則443端口連接成功Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts. Hi youname! You've successfully authenticated, but GitHub does not provide shell access.
- 在
C:\Users\your-username\.ssh\
目錄下創(chuàng)建config文件,輸入
Host github.com
HostName ssh.github.com
Port 443
-
git push
或者git pull
應(yīng)該就成功了
到了這里,關(guān)于$ git push ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!