ubuntu下面git推送到远程库时常见的错误

0 篇文章 0 订阅

一、error: src refspec master does not match any.

此错误说的是你本地库中没有东西,因为你没有将文件提交到库中,用 git commit -m " "

 

二、fatal: 无法读取远程仓库(远程库权限问题)

此错误是由于没有在github远程库中添加ssh key

在github中添加ssh key

1、在ubuntu中生成ssh key

Enter file in which to save the key (/home/xinu/.ssh/id_rsa):这里按回车键

Enter passphrase (empty for no passphrase):如果按回车表示密码为空,请按实际处理

2、复制ssh key

3、粘贴ssh key到github远程库中

三、可能再次推送是出现Agent admitted failure to sign using the key.

这是因为密钥没有加到密钥库中(ssh-add  ~/.ssh/id_rsa)

 

四,fatal: Could not read from remote repository.(前面都解决不了,用以下方法)

修改./git/conmfig文件中的url

url=https://github.com/你的用户名/你的库的名字.git

五、一个仓库已向该引用进行了推送。再次推送前,您可能需要先整合远程变更

解决方案如下:

1.强行上传   git push -u origin +master        

2. 尽量先同步github上的代码到本地,在上面更改之后再上传

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值