Git: Could not resolve host github.com error while cloning remote repository in git

gitgithub

What I did: I have created a remote repository on Github and I am trying to clone the remote repository on my local machine. While cloning I am providing the clone URL & target folder.

But every time I try to clone, I am getting this error:

Error: "fatal: unable to access 'https://github.com/hyperion057/spring-repo.git/': Could not resolve host: github.com"

What do I need to do to connect to GitHub ?

Best Answer

I got a similar error, and it's caused by incorrect proxy setting. This command saved me:

git config --global --unset http.proxy

https version:

git config --global --unset https.proxy