git push报错error: failed to push some refs to 'git@github.com:

Posted racheol

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git push报错error: failed to push some refs to 'git@github.com:相关的知识,希望对你有一定的参考价值。

$ git push -u origin master
To [email protected]:xxx/xxx.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to [email protected]:xxx/xxx.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., git pull ...) before pushing again.
hint: See the Note about fast-forwards in git push --help for details.

原因: 

GitHub远程仓库中的README.md文件不在本地仓库中。
解决方案:

$ git pull --rebase origin master
$ git push -u origin master

 

以上是关于git push报错error: failed to push some refs to 'git@github.com:的主要内容,如果未能解决你的问题,请参考以下文章

git push报错:error: RPC failed; result=22, HTTP code = 413

git 常见冲突解决——git push遇到报错error: failed to push some refs to ‘git@git.xxx.com:xxx/xxx.git

git push error: ! [rejected] failed to push some refs to . . .

git push 报错failed to push some refs to‘xxx‘

git push 报错:failed to push some refs to 'git@git.xxxx:devops/thor.git'

error: failed to push some refs to ‘git@xxx.git‘