git 报错:Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.

7 篇文章 0 订阅
5 篇文章 0 订阅

emmmmmm 报错信息是这样的

$ 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.
To github.com:magicmshing/Tm.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:magicmshing/Tm.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

嗯嗯,报错信息有点多啊,,,
先看第一条Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.叫我们把那个地址添加添加到本地。
那就添加呗

linux的话,就在 /etc/hosts添加:

# set github
13.229.188.59 github.com

windows的话就编辑/c/Windows/System32/drivers/etc/hosts文件

也是添加一样的内容

记住无论是linux还是windows都需要管理员权限才能修改

再次运行

$ git push -u origin master
To github.com:magicmshing/Tm.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:magicmshing/Tm.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

还是有报错,嗯嗯,本人是个英语渣,慢慢吭。

嗯嗯,经过我漫长的百度之后,发现貌似是创建库的时候我写了一个README.md的Markdown文件

解决: 把仓库下拉到本地,在上传

$ git pull --rebase origin master
From github.com:magicmshing/Tm
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
First, rewinding head to replay your work on top of it...
Applying: first commit my wechat miniprogram

然后再继续上传

$ git push -u origin master
Enumerating objects: 33, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (32/32), 92.32 KiB | 153.00 KiB/s, done.
Total 32 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), done.
To github.com:magicmshing/Tm.git
   c4c56ce..0dbd8a6  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

就成功了。我这应该只是坑之一,也只是解决的方法之一。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

之芫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值