git首次提交 遇到的问题

//初始化
$git init
//添加提交文件 $git add
//提交 并备注 $git commit -m "first commit"
// 建立远程git仓库路径位置 $git remote add origin git@github.com:******.git
// 推送到主分支 $git push -u origin master
 
Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.

//执行最后一步可能遇到的问题,
大意就是为IP地址13.229.188.59的主机(RSA连接的)持久添加到hosts文件中,那就来添加吧!
 

linux环境  打开

vim /etc/hosts


添加一行:13.229.188.59  github.com

 

 

Windows环境:打开

C:\Windows\System32\drivers\etc\hosts

添加一行:13.229.188.59  github.com



Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.

//可能还不行 不要慌 向上面一样13.250.177.223 github.com 添加到hosts文件

 

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

//原因:电脑公钥(publickey)未添加至github,所以无法识别。 因而需要获取本地电脑公钥,然后登录github账号,添加公钥至github就OK了

 

输入 ssh-keygen -t rsa 在按三次回车 就生成了本地电脑公匙 打开
/c/Users/Administrator/.ssh/id_rsa.pub 这个文件 复制内容到

打完收工,现在提交就成功了

 

 

 

转载于:https://www.cnblogs.com/shaoping/p/10806151.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值