首页 > Web开发 > 详细

git仓库项目 添加到github非空仓库报错 error: failed to push some refs to 'https://github.com/Qtoken/......'

时间:2020-05-14 12:40:09      阅读:41      评论:0      收藏:0      [点我收藏+]

        error: failed to push some refs to ‘https://github.com/Qtoken/......‘

            1. 问题描述:执行命令:git push origin master    将git仓库项目 添加到github非空仓库报错

                  技术分享图片

 

              2.返回内容:

                 error: failed to push some refs to ‘https://github.com/Qtoken/......‘

                 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.

 

              3.原因:  git仓库与远程连接的github库,内容不一致

 

              4.解决方法:

                 4.1 执行 git pull --rebase origin master    将github仓库内容同步到git仓库

                 4.2 再执行git push origin master     此时git仓库项目正常 添加到github非空仓库

 

git仓库项目 添加到github非空仓库报错 error: failed to push some refs to 'https://github.com/Qtoken/......'

原文:https://www.cnblogs.com/Qtoken/p/12887544.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!