使用 git push 提交代碼時報如下錯誤:
fatal: unable to access 'https://github.com/your_account/repo.git/': Failed to connect to github.com port 443 after 21069 ms: Timed out
這個問題之前也出現(xiàn)過咐蝇,當(dāng)時多提交幾次也就提交成功了。今天又遇到這個問題了。想想有沒有辦法一次性解決拆内,時不時冒出來也挺煩人的。
電腦上裝了 Clash 宠默,想著能不能把 Git 的代理設(shè)置成 Clash 的端口。
使用如下命令設(shè)置 Git 的代理:
$ git config --global http.proxy http://127.0.0.1:7890
$ git config --global https.proxy https://127.0.0.1:7890
執(zhí)行完上面兩個命令后再次執(zhí)行git push
命令提交代碼灵巧,提交成功搀矫。
使用如下命令查看 Git 配置:
$ git config -l
Windows系統(tǒng)按
q
鍵退出 Git 配置查看。