brew update : fatal: 无法连接到 github.com: github.com[0: 140.82.121.3]: errno=操作超时错误

Hil*_*ker 0 git macos homebrew homebrew-cask

更新brew时遇到以下超时错误。

bhupendra@Bhupendras-MBP mobile-app % brew update                                        
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Operation timed out
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Operation timed out

Error: Fetching /usr/local/Homebrew failed!

Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Run Code Online (Sandbox Code Playgroud)

如果有人有解决方案,请帮忙。

Eas*_*y55 6

我通过从 .gitconfig 文件中删除以下行解决了 macOS 上的此问题:

[url "git://github.com/"]
    insteadOf = https://github.com/
Run Code Online (Sandbox Code Playgroud)