git push-u源主致命:无法访问

git push-u源主致命:无法访问,git,github,Git,Github,我已经在我的笔记本电脑上安装了git bash,并试图将我的项目推送到我的GitHub帐户上,但它显示了以下内容: $ git push -u origin main fatal: unable to access 'https://github.com/user_name/repo_name.git/': Could not resolve host: github.com 我已经多次尝试过这个命令,并检查了其他内容。有时我发现,这个命令使bash屏幕卡住,什么也不做-_- 我已尝试此命令

我已经在我的笔记本电脑上安装了git bash,并试图将我的项目推送到我的GitHub帐户上,但它显示了以下内容:

$ git push -u origin main fatal: unable to access 'https://github.com/user_name/repo_name.git/': 
Could not resolve host: github.com
我已经多次尝试过这个命令,并检查了其他内容。有时我发现,这个命令使bash屏幕卡住,什么也不做-_-

我已尝试此命令以确保遥控器正确:

$ git remote -v
得到这个:

origin  https://github.com/user_name/repo_name.git (fetch)
origin  https://github.com/user_name/repo_name.git (push)
我在git配置中使用以下工具检查了我的用户名和电子邮件:

$ git config user.email
$ git config --global user.password

通过我的尝试,发现所有这些内容都正常。

如果您在代理后面,您可能需要定义HTTP\u PROXY/HTTPS\u PROXY环境变量。
或者相反:您在Git中指定了错误的代理:

git config --global --unset https.proxy
或者,根据您的情况:

  • 您可能需要使用公司VPN访问internet
  • 也许吧
  • 你需要检查一下

您的电脑无法解析主机
github.com
。这似乎是网络问题