背景:

我推送一个工程上去:

提示推送失败,git不能完全退出,贴上错误代码:
git push origin master

To ../remote/

![rejected]        master -> master(non-fast forward)

error: failed to push some refs to'../remote/'

To prevent you from losing history,non-fast-forward updates were rejected

Merge the remote changes before pushingagain.  See the 'non-fast forward'

section of 'git push --help' for details.

Google一下:

Thiserror can be a bit overwhelming at first, do not fear.
Simply put, git cannot make the change on the remote without losing commits, soit refuses the push. Usually this is caused by another user pushing to the samebranch.
You can remedy this by fetching and merging the remote branch, or using pull toperform both at once.

In other cases this error is a result of destructive changes madelocally by using commands like git commit --amend or git rebase.
While you can override the remote by adding --force tothe push command, you should only do so if you are absolutely certain this iswhat you want to do. Force-pushes can cause issues for other users that havefetched the remote branch, and is considered bad practice. When in doubt, don’tforce-push.

解决方案:
1.拉取内容

2.合并

问题成功解决

git推送不能完全退出错误相关推荐

  1. Git推送错误: failed to push some refs to ‘git@gitee.com:XXXXXX’

    项目推送时遇Git推送错误: error: failed to push some refs to 'git@gitee.com:name/project.git' 1.分析: 这个问题的产生是因为远 ...

  2. git推送项目到码云(gitee)

    git推送项目到码云(gitee) git推送项目到码云(gitee) 创建账号 创建一个Gitee账号,我使用的是Gitee因为国内速度快~ 本地安装Git 前往 Git 根据操作系统下载Git到本 ...

  3. 【git】git拉取,git推送,git查看,git切换操作命令合集

    文章目录 git拉取 本地连接git账户仓库 本地拉取远程分支代码 git推送 提交代码到远程分支 git查看 查看当前在哪个分支上 查看远程分支 查看所有分支 查看文件在工作区的改动状态 查看文件内 ...

  4. 记录git推送失败:fatal: Could not read from remote repository.

    GitHub远程仓库创建完成,本地推送是出现下面错误 原因是Github 服务器和我们本地的通讯要求使用 SSH Key 来验证 看报错原因可以知道是publickey权限问题 解决方法: 1.查看本 ...

  5. linux git 推送空文件夹

    /********************************************************************************** linux git 推送空文件夹 ...

  6. git 推送出现 “fatal: The remote end hung up unexpectedly“ 解决方案

    在使用git推送项目时候出现 "fatal: The remote end hung up unexpectedly " 原因是推送的文件太大. 解决方案: 在克隆/创建版本库生成 ...

  7. git推送代码详细教程

    前言: 在写这篇文章之前,其实我已经写过一次教程:git码云的一次配置全记录,但是当时写那个教程的时候,对于git的使用还是懵懵懂懂的,如果是新手完全照着做可能会出现一些意想不到的问题,所以在经历N次 ...

  8. 功能分支重新设置后,Git推送被拒绝

    好的,我以为这是一个简单的git场景,我缺少什么? 我有一个master分支和一个feature分支. 我在master上做一些工作,在feature上做一些,然后再在master上做更多的工作. 我 ...

  9. 如何正确强制执行Git推送?

    我已经建立了一个远程的非裸露的"主"仓库,并将其克隆到我的计算机上. 我进行了一些本地更改,更新了本地存储库,然后将更改推回到远程仓库中. 到那时为止一切都很好. 现在,我不得不更 ...

最新文章

  1. 为什么Python发展这么快,有哪些优势?
  2. linux查看wan的ip地址,查看wan口ip地址操作方法
  3. 获取windows帐户的SID值
  4. 【练习5.9】图像掩码、礼帽、cvCopy、图像融合、cvCvtColor
  5. 【POJ - 3342】Party at Hali-Bula(树形dp,最大独立集,是否有唯一解)
  6. [转载]WSDL 教程
  7. verilog学习记(tinyriscv mcu设计)
  8. 做餐饮,要会算细账,要少折腾
  9. 新手老问题---------跨线程的控件访问
  10. Java中遍历Set集合的三种方法
  11. WIN10平板 如何关闭自动更新
  12. 原生js写小球向右移动移动一定距离停止运动及小球加速运动
  13. 设置计算机从u盘启动的英文,如何在BIOS中设置U盘启动
  14. div 跟着鼠标移动
  15. Codeforces Round #738 (Div. 2) 2021.08.16
  16. Flink 生产环境配置建议
  17. 移动光猫只有一个lan口?其他是电视用,如何增lan口
  18. 程序员怎么合理的利用自己的业余时间接单赚钱,怎么才能赚到比本职工作还多的钱呢?
  19. android之银联支付,android端银联支付
  20. 如何确保按时交付项目? 有哪些实用方法

热门文章

  1. 电脑快速复制粘贴大文件
  2. outlook默认签名设置_如何将默认签名添加到Outlook会议请求
  3. 到了2020年,技术水平到底需要达到怎样的程度才能成为顶级的阿里P8架构师
  4. 2020年NOC创新编程赛编程猫热身活动部分模拟题和答案解析
  5. 【转载】CodeWarrior IDE使用tips之prm链接文件详解(自定义存储器分区以及自定义RAM数据初始化与在RAM中运行函数)...
  6. 男女在床上说的28个NB笑话!
  7. 英语和编程到底是什么关系?
  8. Perl面向对象编程入门
  9. 工作总结:简明扼要,突出重点
  10. 信息学奥赛(NOIP/CSP-J/S)学习全目录