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

git push报错error: failed to push some refs to ‘git@github.com‘
强烈推介IDEA2021.1.3破解激活,IntelliJ IDEA 注册码,2021.1.3IDEA 激活码  

大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说git push报错error: failed to push some refs to ‘git@github.com‘,希望能够帮助大家进步!!!




$ git push -u origin master
To git@github.com:xxx/xxx.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com: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

 

本文来源huayang183,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/17847

发表评论