出現(xiàn)問題:
在執(zhí)行 flutter upgrade 時出現(xiàn) fatal: unable to access 'https://github.com
示例
ming@bogon ~ % flutter upgrade
ProcessException: Process exited abnormally:
fatal: unable to access 'https://github.com/flutter/flutter.git/': Failed to
connect to github.com port 443: Operation timed out
Command: git fetch --tags
解決方案:
方案1:
在開啟shadowsocks的前提下,手動配置git的代理。git客戶端輸入如下兩個命令就可以了。
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
??注意:http://127.0.0.1:1080為shadowsocks 中HTTP代理設(shè)置中設(shè)置的地址與端口。
如下圖:

1615546956401.jpg
http://也可以改成sockets5://,但是區(qū)別在于:socks5不支持通過pubkey免密登錄github,每次提交代碼只能輸入用戶名和密碼。http可以支持免密登錄。
取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy
方案2:
1、看看你的git配置
git config --global -l
如果你沒有任何與https代理相關(guān)的內(nèi)容,例如https_proxy = …問題不在這里。
如果您有與https代理相關(guān)的內(nèi)容,請將其從?/ .gitconfig文件中刪除,然后重試。
2、如果仍然不起作用,請取消設(shè)置環(huán)境變量
env|grep -i proxy
你應(yīng)該有一行或幾行https_proxy = …
使用以下內(nèi)容逐個取消設(shè)置:取消設(shè)置https_proxy(或HTTPS_PROXY,具體取決于變量的名稱)
3、再次檢查環(huán)境變量
env|grep -I proxy
如果它沒有顯示任何你應(yīng)該是好的。
注意:此解決方案可以應(yīng)用于http和https代理問題。只是變量名稱從https更改為http。
方案一和方案二是同一種方法,推薦使用方案1進行解決。