一、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上的代码到本地,在上面更改之后再上传

本文介绍了使用Git过程中常见的错误及其解决办法,包括错误代码解释、SSH密钥配置、远程仓库权限问题等,并提供了具体的操作步骤。
1257

被折叠的 条评论
为什么被折叠?



