同步github

在本地写完代码,同步到github上时,报错:

root@tegra-ubuntu:/home/ubuntu/pathplan/pathPlan-test# 
root@tegra-ubuntu:/home/ubuntu/pathplan/pathPlan-test# git push origin master
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? 
Host key verification failed.
fatal: Could not read from remote repository.


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

root@tegra-ubuntu:/home/ubuntu/pathplan/pathPlan-test# 


怀疑应该时ssh传数据验证失败。试了一下吧origin删了,重新生成一边:

(查看远程仓库命令:git remote -v)

删除远程仓库命令:git remote rm origin

添加远程仓库命令:git remote add origin2 https://github.com/MercyMM/RT-Path-Planning-and-Reconstruction

 重新生成后再git push还是上面哪个错误。


于是重新生成一边ssh密钥:ssh-keygen -t rsa -C "e-mail@xx.com"

生成过程中需要输入密钥保存地址,默认地址是:“ Enter file in which to save the key (/root/.ssh/id_rsa):”。

这时候反应过来了。原来我用的root用户,它找密钥的时候找的是/root/.ssh/。我之前的密钥是存在/home/ubuntu/.ssh/目录下的。遂将用户切换成ubuntu,然后再git push,变成功了。

这里我生成密钥的时候把/home/ubunt/下的密钥覆盖了,所以我有把新的公钥放到github里。


这里有个小问题。我之前写的代码commit后,时间记录的是2017年。但是后面由于没插网线,再commit时时间是2000年


然后push到github上后,


它竟然是安装时间排序,而不是逻辑先后排序。这个不知道会不会造成什么隐患。。。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值