Push to Github:could not resolve host:github.com

Source: Internet
Author: User

System: Mac OS X 10.11.3

Action: Push to GitHub

The error is as follows:
Git push origin
Ssh:could not resolve hostname ssh.github.com:Name or service not known
Fatal:could not read from remote repository.

Sure you have the correct access rights
and the repository exists.
Make: * [deploy] Error 128

Workaround 1:
Step1. Ping github.com
Get the IP to github.com to 192.30.252.128
Step2. Add a line to the/etc/hosts as follows:
192.30.252.128 github.com

Workaround 2:
Execute the following Python code with root privileges

1 #!/usr/bin/python2 #Coding=utf83 4 ImportSocket5 6Host ='github.com'7 8 Try:9With open ('/etc/hosts','A +') as FP:TenIP =Socket.gethostbyname (host) OneFp.write (' '. join ([IP, Host,'\ n'])) A exceptbaseexception as E: -     Print(e) - Else: the     Print('sucess')

Special: Some friends can't find /etc/hosts .

Reference method:

First step: Please open the Finder app in your MAC system first,

The second step: Please press the shortcut key combination shift+command+g three combination keys, and enter the path of the Hosts file:/etc/hosts,

Step three: You can then see the Hosts file in the Finder window,

The fourth step: copy out the changes and drag back the cover to take effect, the success, to enjoy the push bar.

Pay tribute to the original, I have just encountered this problem, collated and shared to everyone.

http://blog.csdn.net/piaotiejun/article/details/48734175

Push to Github:could not resolve host:github.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.