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

  • 相关阅读:
    swift 自学小计
    修改非空表字段类型Oracle
    DBNull.value
    修改SqlServer字段长度
    未在本地计算机上注册“Microsoft.Ace.OleDB.12.0”
    引用dll文件要复制到本地
    oracle与SqlServer连接串服务器地址
    生成几乎永不重复的串
    安装SqlServer2008后vs中dev控件消失
    Ios项目添加Pods
  • 原文地址:https://www.cnblogs.com/thqy39/p/5341911.html
Copyright © 2011-2022 走看看