如果你的电脑开启了代理,那么git就会出现这种情况,git不会自动使用代理,需要我们手动开启代理

通过下面的命令开启代理
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy