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代码
#!/usr/bin/python
#coding=utf8 import socket host = 'github.com' try:
with open('/etc/hosts', 'a+') as fp:
ip = socket.gethostbyname(host)
fp.write(' '.join([ip, host, '\n']))
except BaseException as e:
print(e)
else:
print('sucess')
特别的:部分朋友找不到/etc/hosts
参考办法:
第一步:请先打开 Mac 系统中的 Finder 应用,
第二步:请按快捷键组合 Shift+Command+G 三个组合按键,并输入 Hosts 文件的所在路径:/etc/hosts,
第三步:随后即可在 Finder 窗口中看到 Hosts 文件了,
第四步:拷贝出来修改后拖回覆盖即可生效,就此成功,去尽情的push吧。
向原者致敬,我刚才碰到这个问题,整理分享给大家。
http://blog.csdn.net/piaotiejun/article/details/48734175
Push to GitHub:could not resolve host: github.com的更多相关文章
- could not resolve host: github.com 问题解决办法
向github提交代码时出现问题,如图: 代码push失败,提示could not resolve host: github.com 解决办法: 1.打开终端,输入:ping github ...
- 修改ubuntu DNS的步骤/wget url报错: unable to resolve host address的解决方法
wget url 报错:unable to resolve host address ‘url’,显然是无法解析主机地址,这就能看出是DNS解析的问题.解决办法就是配置可用的dns 一般是修改成为谷歌 ...
- 关于github报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
当执行git命令如:git clone.git pull等等 出现报错:ssh: connect to host github.com port 22: Connection timed outfat ...
- linux安装软件时提示找不到镜像的问题:Couldn't resolve host 'mirrorlist.centos.org'
问题:[root@cddserver2 ~]# yum -y install gcc-*Loaded plugins: fastestmirror, prestoCould not retrieve ...
- cents上运行wget报错:unable to resolve host address
wget命令报错.无法解析域名"www.keepalived.rog" [vagrant@RS1 download]$ wget http://www.keepalived.org ...
- oracle linux 7 yum报错解决:COULD NOT RESOLVE HOST: YUM.ORACLE.COM
虚拟机中yum报错 [root@localhost ~]# yum -y install oracle-rdbms-server-11gR2-preinstall Loaded plugins: la ...
- git 出现错误 Could not resolve host: github.com 或者 gitlab.com 或者gerrit相关( 自有服务 )
原来是因为github.com没有被主机给解析 1.第一步是 ping 你的gitlab 或者 github服务器ip地址 如果每隔几秒有 time = xx.ms 刷新 就证明是通的 2. 编辑 e ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- ssh: connect to host github.com port 22: Connection timed out
问题描述 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git Cloning into 'MaugerWu.github.io'... ...
随机推荐
- delphi xe2 panel 无法 遮盖 label 的 解决方案。
百度 没有找到此答案. 问群,也没答案. 根据群友的提示. 找到的解决的办法. 很简单. ParentBackground 设置为 false.
- git设置忽略文件.gitignore
在仓库目录下新建一个名为.gitignore的文件(因为是点开头,没有文件名,没办法直接在windows目录下直接创建,必须通过右键Git Bash,按照linux的方式来新建.gitignore文件 ...
- CentOS 7下升级python版本到3.X
由于python官方已宣布2.x系列即将停止支持,为了向前看,我们升级系统的python版本为3.x系列服务器系统为当前最新的CentOS 7.4 1.安装前查看当前系统下的python版本号 # p ...
- c#生成html静态文件时出现空白行,怎么去掉utf-8中的bom
public static void UTF8RemoveBOM(string filepath) { UTF8RemoveBOM(filepath, filepath); } public st ...
- /usr/bin/python^M: bad interpreter: No such file or dir解决办法
Linux直接./xx.py执行python脚本时报错 修改脚本文件编码 $vi xx.py $set ff=unix $:wq
- docker--container之间的link,bridge create
container的name和ID一样,也是唯一的,当不知道container的IP时,可以用name替代,但需要先配置link 下面创建两个container 时,未配置link所以ping nam ...
- qt 如何使用 lamda 表达式接收线程中发射的数据,并在里面更新 UI ?
Qt 信号和槽连接方式 常量 描述 Qt::AutoConnection (默认)如果接收方位于发出信号的线程中,则使用Qt::DirectConnection.否则,使用Qt::QueuedConn ...
- BUUCTF CRYPTO部分题目wp
对密码学了解不多,做一下熟悉熟悉 1,看我回旋踢 给的密文synt{5pq1004q-86n5-46q8-o720-oro5on0417r1} 简单的凯撒密码,用http://www.zjslove. ...
- ros节点启动和关闭相关
Ros node启动与关闭 1. ros运行单位: Ros程序运行的单位是ros node. 2. ros 节点的启动: (1)初始化ros节点:通过调用ros::init()接口实现:可以通过参数指 ...
- 2019 ICPC Universidad Nacional de Colombia Programming Contest C D J
C. Common Subsequence 题意:给出长度为n两个串,求两个串的最长公共子序列len,如果len>=0.99*n,两个串就是亲兄弟否则不是. 解法:朴素的求LCS的时间复杂度是O ...