zoukankan      html  css  js  c++  java
  • Push to GitHub:could not resolve host: github.com

    系统:Mac os x 10.11.3

    操作:Push to GitHub

    错误如下: 
    git push origin 
    ssh: Could not resolve hostname ssh.github.com: Name or service not known 
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights 
    and the repository exists. 
    make: * [deploy] 错误 128

    解决方式1: 
    step1. ping github.com 
    获取到github.com的ip为192.30.252.128 
    step2. 在/etc/hosts(可以通过shift+command+g快速跳转)中添加一行如下: 
    192.30.252.128 github.com

     

    解决方式2: 
    以root权限执行如下python代码

     1 #!/usr/bin/python
     2 #coding=utf8
     3 
     4 import socket
     5 
     6 host = 'github.com'
     7 
     8 try:
     9     with open('/etc/hosts', 'a+') as fp: 
    10         ip = socket.gethostbyname(host)
    11         fp.write(' '.join([ip, host, '
    ']))
    12 except BaseException as e:
    13     print(e)
    14 else:
    15     print('sucess')

    特别的:部分朋友找不到/etc/hosts

    参考办法:

    第一步:请先打开 Mac 系统中的 Finder 应用,

    第二步:请按快捷键组合 Shift+Command+G 三个组合按键,并输入 Hosts 文件的所在路径:/etc/hosts,

    第三步:随后即可在 Finder 窗口中看到 Hosts 文件了,

    第四步:拷贝出来修改后拖回覆盖即可生效,就此成功,去尽情的push吧。

    向原者致敬,我刚才碰到这个问题,整理分享给大家。

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

  • 相关阅读:
    8-16 不无聊序列 non-boring sequences uva1608
    8-8 Ddfense Line uva1471 优先级队列
    8-12 Erratic Expansion uva12627
    8-4 Fabled Rooks uva11134
    8-10 Coping Books uva714
    8-13 Just Finish it up uva11093
    8-11 Add All uva 10954
    8-2 Building for UN Uva1605
    css定位.py
    处理HTML5视频播放.py
  • 原文地址:https://www.cnblogs.com/thqy39/p/5341911.html
Copyright © 2011-2022 走看看