Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Git GitHub and Other Remote Repositories Cloning a Repository

Unable to connect Github

I using my local machine to connected Gitbut but it show me this :

$ git clone https://github.com/stephencow/firstcode.git
Cloning into 'firstcode'...
fatal: unable to access 'https://github.com/stephencow/firstcode.git/': Could no                                                                                                                                                 t resolve host: github.com

or

$ git push -u origin master
fatal: unable to access 'https://github.com/stephencow/pratice.git/': Could not resolve host: github.com

any other have has the same question? Need Help Please ......

Thanks it very helpful and I'm try to looks for the proxy username and password ,but my desktop don't have it Thannks anyway

2 Answers

Steve Mustanski
Steve Mustanski
15,093 Points

I don't have an answer, since that could be caused by many issues.

Is your local machine a company provided laptop or are you at work? If so, it could be a proxy issue and will require some research to configure your machine. In some cases, it isn't possible. My company doesn't allow access to github.com for most users.

If it is your personal laptop, there are a few things to try.

The first answer over on stack overflow might give you some ideas if it is a company laptop (unless they block github). The 3rd may help if it is your own machine.

https://stackoverflow.com/questions/20370294/could-not-resolve-host-github-com-error-while-cloning-remote-repository-in-git

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Basically, that means that Git can't get the IP address of github.com from a domain name server. I would recommend the same things Steve Mustanski did. On an even more basic level, though:

  • What OS are you running? If you're running Windows, what console/shell are you using?
  • Can you type https://github.com into a browser's address bar and visit the site that way? Or are you blocked there too?
  • You might try the same steps in a Workspace and see if that works.