git pull origin master --allow-unrelated-histories  //把远程仓库和本地同步,消除差异

git add .

git commit -m"XXX"

git push origin master

上述有时候可能不能彻底解决问题 因为这里边可能存在 你提交的 和 服务器上的 是两个项目

需要:

git pull origin master --allow-unrelated-histories

这条命令允许了不同项目的合并

然后接下来

git push origin master

上传成功。

git push报错! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://gitee.com/XXX.git的更多相关文章

  1. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  2. 关联吸纳的remote首次push报错rejected

    F:\abb-iot\DmsAPI\DmsAPI (master -> origin) λ git push --set-upstream github master To github.com ...

  3. error: failed to push some refs to 'https://gitee.com/xxx/xxx'

    一开始以为是本地版本和线上的差异 果断先直接pull  之后 还是不对,哎 不瞎搞了  搜... 获得消息: git pull --rebase origin master 原来如此:是缺失了文件

  4. git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra

    推送本地代码到github报错 git push报错 ! [rejected] master -> master (non-fast-forward) error: failed to push ...

  5. 【Git】git rebase报错new blank line at EOF.处理

    执行git rebase报错如下: First, rewinding head to replay your work on top of it... Applying: 本次提交信息 .git/re ...

  6. git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to

    今天对代码进行了修改优化,然后往往远程push,但push后报错了 git操作 git add . git commit -m"fix" git push origin maste ...

  7. git提交远程报错[rejected] master -> master (fetch first)

    1 先下载git for windows 然后一直点下一步安装. 2 安装之后,选择git gui.生成ssh 链接 git 公钥. 用命令也可以: $ ssh-keygen -t rsa -C &q ...

  8. To ssh://xxx.com:8022/test/project.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://xxx.com:8022/test/project.git'

    To ssh://xxx.com:8022/test/project.git ! [remote rejected] master -> master (pre-receive hook dec ...

  9. git 报错:error: failed to push some refs to 'https://github.com/Anderson-An/******.git'(已解决)

    提交push 报错: $ git push origin masterTo https://github.com/Anderson-An/******.git ! [rejected] master ...

随机推荐

  1. Asp.net禁用site.Mobile.Master

    RT,在asp.net新的项目中遇到的一个问题.项目使用了Boostrap后网页打开是正常的,但是换成移动端打开这个网页的时候就奇怪了.很多样式不见了.原来是自动切换到了site.Mobile.Mas ...

  2. 小程序分享报错 Cannot read property 'apply' of null;at page XXX onShareAppMessage function

    Cannot read property 'apply' of null;at page XXX onShareAppMessage function 然后看了下自己的代码,分享按钮在子组件里, at ...

  3. 移动MAS短信平台发送短信

    MAS短信平台发送短信分为两种方式 参考文档下载 一.sdk调用 using mas.ecloud.sdkclient; using System; namespace 短信发送 { class Pr ...

  4. LCT(1)

    LCT(Link-Cut Tree,动态树)是一个支持动态修改树的结构的数据结构,其基本操作有 \(\texttt{access}\) , \(\texttt{findroot}\) , \(\tex ...

  5. Django 初体验

    Django 依赖的python 基础环境安装: https://www.runoob.com/django/django-install.html Django安装参考官网文档: https://d ...

  6. Django 异常处理

    我们新建一个py文件 # 在restful中导入exception_handler from rest_framework.views import exception_handler from dj ...

  7. mybaits的注解方式与配置文件方式比较

    注解方式比配置文件方式简单了更多. 俩种配置 一个是制定配置文件路径,一个直接class指向dao层接口 只需加一个注解@**** 就能够实现 比写一个xml的配置文件简单更多.

  8. UVA - 12113 Overlapping Squares(重叠的正方形)

    题意:给定一个4*4的棋盘和棋盘上所呈现出来的纸张边缘,问用不超过6张2*2的纸能否摆出指定的形状. 分析:2*2的纸在4*4的棋盘上总共有9种放置位置,枚举所有的放置位置即可.枚举情况总共种. #p ...

  9. 新部署到服务器 报 The requested URL /home/profession was not found on this server. 错误

    The requested URL /home/profession was not found on this server. 通过xxx.com, 首页可以正常访问,xxx.com/xx/xx 就 ...

  10. ubuntu16.04 重置mysql密码

    先登陆服务器,找到自己的my.cnf文件,通常会在 /etc目录下(如果不在,可以用find / -name my.cnf命令找一下), 然后使用 vi my.cnf 命令编辑该文件(建议先备份),在 ...