Could not resolve host github com

+1 vote

 I am using the clone command in Git Bash, but it shows me the below error.

fatal: unable to access could not resolve host: GitHub

How can I solve this error?

Apr 10, 2020 in Git & GitHub by akhtar
• 38,260 points
158,799 views
You'vе heard thаt it's wise to lеarn frоm expеriencе, but it is wisеr to lеаrn frоm thе exреriеncе of others.

2 answers to this question.

+3 votes
Best answer

Hi@akhtar,

This can be caused in incorrect proxy settings , or error typing name, make sure you're using the exact URL of whatever you're trying to do.

Try these commands.

git config --global --unset http.proxy

Also set user- name and user-email.

git config --global user.name "user name"
git config --global user.email "user email"

Hope this will solve your error.

answered Apr 10, 2020 by MD
• 95,460 points

selected Dec 15, 2020 by akhtar
thank you this worked for me too
Thank you very much for this. I had the same issue and your first option worked for me.
Thank you!!!

Worked :)
Thanks for this, it worked for me
+2 votes

It might be the error that is caused by a protected repository. Check if you have privileges to that repository, or if you have changed your password. In any of these cases...execute the following commands:

git init

git remote add origin https://github.com/your_repository.git

git config --local credential.helper ""

This command will ask you to enter  your credentials when you execute git pull or push commands. 

So now execute the following command, so instead of cloning we are pulling from the repository.

git pull origin master

answered Sep 20, 2020 by Sugunasri
• 180 points