无法访问无法解析主机

unable to access Could not resolve host

我在 Ubuntu 上使用 VMware 开发代码。一切都很好,我正在编码并将其提交到我的 Github 帐户,没有任何问题。但突然它停止工作,它会说: 致命:无法访问“https://github.com/hm0ss/nst.git/”:无法解析主机:github.com

我做了什么?我在 google 上搜索并使用了 config 命令和其他建议,但无济于事。 我还创建了另一个 git 存储库,但也失败了。 我切换到 GitLab 并在那里创建了一个存储库,但没有任何好处: "Unable to access 'https://gitlab.com/hma.globe/nst2.git/': Could not resolve host: gitlab.com" 我需要说我正在使用代理(确实是袜子),但即使断开袜子服务器(或从 google chrome 中删除代理)也不起作用。 顺便说一句,我什至切换到 windows 并尝试提交但遇到了同样的错误。 尝试了大约 2 个小时后,我现在遇到了大麻烦。

首先检查问题是否仍然存在。

GitHub status 最近(在过去几个小时内)报告了几个问题,这可以解释 "sudden" 你的问题。

例如:this incident:"We are investigating degradations to GitHub.com".

GitLab had no recent issues though,这意味着您这边的网络问题也可能是一个因素。

OP 重置了 VMware 以解决网络问题。
并完全重置为 origin/master + 将当前工作复制到 lake 并将新提交成功推送到 GitHub.

我遇到过这样的问题,但没有一套特定的说明来解决这个问题。 但是我尝试了 运行ning 这个命令,它对我有用

git config --global --unset http.proxy
然后运行

git remote  set-url origin <repository link>

提交新更改后尝试 运行ning
如果常规推送给您一个错误,则此命令

git push origin <branch>  --force