linux下git push出现“更新被拒绝,因为远程仓库包含您本地尚不存在的提交。”问题的处理

摘要:
再次推送前,您可能需要先整合远程变更提示:。

一、现象:

(base) [root@DL xbiquge]# git push -u origin master
To https://github.com/sfccl/xbiquge.git
! [rejected] master -> master (fetch first)
error: 无法推送一些引用到 'https://sfccl:密码@github.com/sfccl/xbiquge.git'
提示:更新被拒绝,因为远程仓库包含您本地尚不存在的提交。这通常是因为另外
提示:一个仓库已向该引用进行了推送。再次推送前,您可能需要先整合远程变更
提示:(如 'git pull ...')。
提示:详见 'git push --help' 中的 'Note about fast-forwards' 小节。

二、原因及处理办法

1、问题出现的原因是:在网页进行了push提交动作。

2、处理办法:强制push,方法如下:

(base) [root@DL xbiquge]# git push origin +master
枚举对象: 149, 完成.
对象计数中: 100% (149/149), 完成.
Delta compression using up to 4 threads.
压缩对象中: 100% (147/147), 完成.
写入对象中: 100% (149/149), 86.90 MiB | 1.71 MiB/s, 完成.
Total 149 (delta 74), reused 0 (delta 0)
remote: Resolving deltas: 100% (74/74), done.
To https://github.com/sfccl/xbiquge.git
+ f7ac142...73353bd master -> master (forced update)

三、小结

避免这种情况的注意事项:不要通过网页向仓库提交文件。

免责声明:文章转载自《linux下git push出现“更新被拒绝,因为远程仓库包含您本地尚不存在的提交。”问题的处理》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇数字语音信号处理学习笔记——同态处理语音信号(1)oracle SEQUENCE 创建, 修改,删除下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

hexo d命令报错 ERROR Deployer not found: git

我已经在站点配置文件中写入了: deploy: type: git repo: git@github.com:lanlan2017/lanlan2017.github.io.git # Github pages地址 branch: master 但是执行hexo d报错 ERROR Deployer not found: git 解决方案...

reindex-maven 私服(nexus)架设以及项目管理中遇到的问题及解决方案(updating)

---    用maven 的过程中 大问题小问题实在是不少 ,就不一篇文章一篇文章的写了,干脆写在一起 ---- -------  nexus 加索引  点击Administration菜单下面的Repositories,将这三个仓库Apache Snapshots,Codehaus Snapshots,Maven Central的configura...

Git入门常用命令

Git是什么 Git是一个开源的[分布式][版本控制系统],用于敏捷高效地处理任何或小或大的项目,事实上它是与GitHub搭配起来使用的。Git 是Linus Torvalds为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。 分布式相比于集中式的最大区别在于开发者可以提交到本地,每个开发者通过克隆(git clone),在本地机器上拷...

git 场景 :从一个分支cherry-pick多个commit

场景: 在branch1开发,进行多个提交,这是切换到branch2,想把之前branch1分支提交的commit都【复制】过来,怎么办? 首先切换到branch1分支,然后查看提交历史记录,也可以用sourceTree查看,也可以用命令git log 例如我的git log 如下: commit 023sb6f299849a1fec3bbe72baaf3...

Spring源码系列1

一、搭建源码环境 从Spring官网下载源码,我下载的是spring 4.3.26。 spring源码下载地址:https://github.com/spring-projects/spring-framework/releases spring发布包下载地址:https://repo.spring.io/release/org/springframewo...

TortoiseGit Manual 学习

在线文档https://tortoisegit.org/docs/tortoisegit/ Preface 1. Introduction 2. TortoiseGit Daily Use Guide 3. The GitWCRev Program Glossary Index Preface Audience Reading Guide Tortoise...