Git提示:ssh: Could not resolve hostname github.com: No address associated with hostname
今天本地Git Push 代码推送远程分支,提示如下错误信息:
zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ git push
ssh: Could not resolve hostname github.com: No address associated with hostname
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
Google 一下,大家的建议是重新配置ssh Key。
重新生成GitHub SSH Key 值,请参考如下指令
zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ git config user.name
zhouzhiwengangzzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ git config user.email
zhouzhiwengang@163.comzzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ ssh-keygen -t rsa -C "zhouzhiwengang@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/zzg/.ssh/id_rsa):
/c/Users/zzg/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/zzg/.ssh/id_rsa
Your public key has been saved in /c/Users/zzg/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:ikXfYyRhWd/897SdPdU+Q/NKTgoZVFm4a4/4qzICidw zhouzhiwengang@163.com
The key's randomart image is:
+---[RSA 3072]----+
| oo. .+. |
| ... ooo |
| . . o ..o |
| . . = . ..|
| . o .. S = . o*|
| o Eo . . +o .o@|
| ... oo oo**|
| . o ...=..+|
| . o.o+.o |
+----[SHA256]-----+zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ eval $(ssh-agent -s)
Agent pid 909zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ ssh-add /c/Users/zzg/.ssh/id_rsa
Identity added: /c/Users/zzg/.ssh/id_rsa (zhouzhiwengang@163.com)zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ clip < /c/Users/zzg/.ssh/id_rsa.pub
执行以上指令完成本机SSH Key值生成,并将生成的Key 拷贝至Git 账户/Setting/SSH key 设置。
温馨提示:SSH Key 生成时,会提示本地已经存在是否覆盖,选择y,再Enter回车。
重新尝试git 代码推送
zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace (master)
$ ssh -T git@github.com
ssh: Could not resolve hostname github.com: No address associated with hostname
错误含义:域名解析无法找到GitHub.
Google 一下,大家的解决办法时,将GitHub IP地址配置至hosts文件。
解决Github 域名方法问题:
第一步:查询Github 真实IP地址,可以通过 https://www.ipaddress.com/查询。
第二步:在本机:C:\Windows\System32\drivers\etc\hosts 文件中,添加如下配置:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
140.82.113.4 github.com
至此,我的Git代码推送恢复正常。
Git提示:ssh: Could not resolve hostname github.com: No address associated with hostname相关推荐
- github 公钥 私钥_ubuntu git生成ssh key (公钥私钥)配置github或者码云
Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置. github的SSH配置如下: 设置Git的user name和email: git confi ...
- git 生成ssh key_ubuntu git生成ssh key (公钥私钥)配置github或者码云
Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置. github的SSH配置如下: 设置Git的user name和email: git confi ...
- git 出现错误 Could not resolve host: github.com 或者 gitlab.com 或者gerrit相关( 自有服务 )...
原来是因为github.com没有被主机给解析 1.第一步是 ping 你的gitlab 或者 github服务器ip地址 如果每隔几秒有 time = xx.ms 刷新 就证明是通的 2. 编辑 e ...
- Android studio之提示Failed to resolve: com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46
1.错误提示如下 Failed to resolve: com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46 Show in Project ...
- 【Git笔记1】本地项目与GitHub远程仓库互联
秋招面试的时候,面试官就问了我:你会Git吗?我迟疑看着他,他微笑着说,入职前要抓紧时间好好学习一下. 由于地理位置优势先来公司熟悉下环境,咨询算法组组长入职前可以做些什么准备?组长说,Git要好好学 ...
- [git]ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known
ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known This sounds ...
- git报错 ssh: Could not resolve hostname gitee.com:xxxxxx: Name or service not known fatal
问题 使用git进行push操作时突然出问题,报错如下: ssh: Could not resolve hostname git: xxxxx:Name or service not known fa ...
- ssh: Could not resolve hostname github.com
ssh: Could not resolve hostname github.com: Name or service not known fatal 可能原因 github上的key出了问题 个人网 ...
- 错误提示:ssh: Could not resolve hostname devsrv: Name or service not known
ssh: Could not resolve hostname devsrv: Name or service not known ubuntu下 scp时出错:ssh: Could not reso ...
最新文章
- Javascript闭包和闭包的几种写法及用途
- 英伟达GPU“屠榜”,谷歌TPU“退赛”,MLPerf最新推理榜单出炉
- puppet 执行source
- leetcode63. Unique Paths II
- math.h头文件中声明了常用的一些数学运算
- 大型分布式网站架构设计与实践 第一章《面向服务的体系架构(SOA)》
- 浏览器解析编码优先级
- ArcGIS 10.2 Calculate Value(Data Management) 工具的使用
- 跳坑成功,手摸手带你使用PHP连接Oracle数据库
- c语言建立迷宫坐标,c语言 找到迷宫出口并显示坐标,可以自定义迷宫或者选用已经设计好的迷宫...
- 题号的随机抽取滚动背景以及题号展示背景如何定制?
- Stack with max and min 查找栈中最大最小数
- PS一键磨皮美白扩展插件Delicious Retouch 5.0 汉化集合版 Win/Mac
- Python 商务统计学 lesson 01
- 玩赚亚丁号---薅羊毛专业版
- Egret引擎学习笔记
- 教育企业邮箱购买哪个好用,还有英文邮件系统?
- 公链、私链、联盟链优缺点
- 字体样式字体分类字体样式二
- 医疗图像处理与深度学习(二)