Git push 报错error: failed to push some refs to ‘[email protected]

出错过程:我在github上创建了一个仓库并直接在github上在线创建了一个readme.md文件就是点击了这个
Git push 报错error: failed to push some refs to ‘[email protected]‘
后来上网查了资料说是如果在github上进行了在线的修改;或者你直接在github上的某个库中添加readme文件或者其他什么文件,但是没有对本地库进行同步。这个时候当你再次有commit想要从本地库提交到远程的github库中时就会出现push失败

Git push 报错error: failed to push some refs to ‘[email protected]‘

解决方法:这个问题是因为远程库与本地库不一致造成的,那么我们把远程库同步到本地库就可以了

git pull --rebase origin master

这样就可以了

Git push 报错error: failed to push some refs to ‘[email protected]‘

相关文章: