git错误--ssh: Could not resolve hostname ssh.github.com: Name or service not known--解决方式
2015-09-25 15:52
891 查看
错误如下:
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中添加一行如下:
192.30.252.128 github.com
解决方式2:
以root权限执行如下python代码
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中添加一行如下:
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')
相关文章推荐
- 详解Java GC的工作原理+Minor GC、FullGC
- java获取相对时间 1小时前 1天前
- MyEclipse导入的项目js文件乱码
- java日期时间操作
- ASP.NET使用包含文件,比如asp中用include的方法
- ubuntu14 安装JDK 8
- Java基础知识强化88:BigDecimal类之BigDecimal类引入和概述 以及 BigDecimal的使用(加减乘除)
- Python字符串
- php for循环之9乘9乘法表实例代码
- JAVA内部类
- C# 托管内存与非托管内存之间的转换
- C语言的基本知识
- Java的RTTI机制–反射
- python random模块
- C语言的几个基本结构
- Python开发者须知 —— Bottle框架常见的几个坑
- Spring 框架简介
- Java基础知识强化87:BigInteger类之BigInteger加减乘除法的使用
- Java多线程:Callable、ExecutorService、CountDownLatch、Future和FutureTask
- java 字符串排列组合