Git - git push origin master 报错的解决方法
亲测实用,转载保存,原文地址:https://blog.csdn.net/kangvcar/article/details/72773904
错误提示如下:
[root@linux1 php]# git push -u origin master
To git@github.com:kangvcar/Results-Systems--PHP.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:kangvcar/Results-Systems--PHP.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 merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:
GitHub远程仓库中的README.md文件不在本地仓库中。
解决方案1:
我们只需加上 -f 参数即可push成功。
[root@linux1 qimo]# git push -f
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git) Counting objects: 53, done.
Compressing objects: 100% (53/53), done.
Writing objects: 100% (53/53), 1.35 MiB | 55.00 KiB/s, done.
Total 53 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), done.
To git@github.com:kangvcar/Results-Systems--PHP.git
+ fbe05e8...70b187d master -> master (forced update)
解决方案2:
我们只需加上 –rebase 参数然后再重新 push 一次即可。
[root@linux1 qimo]# git pull --rebase origin master
[root@linux1 qimo]# git push -u origin master
Git - git push origin master 报错的解决方法的更多相关文章
- 解决Git - git push origin master 报错
关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 欢迎大家关注我的微信公众号:「醉翁猫咪」 原因:github仓库中没有README.md文件 解决如下: 重新输入git push ...
- git push origin master 报错 remote rejected] master -> master (branch is currently checked out)
解决办法: 977down vote You can simply convert your remote repository to bare repository (there is no wor ...
- Vue 项目在其他电脑 npm run dev 运行报错的解决方法
一个 Vue 项目从一台电脑上传到 github 上之后,再另外一台电脑上 git clone .并使用 npm run dev 或 npm run start 发生以下报错的解决方法. 报错原因 ...
- windows下使用GNU make命令报错的解决方法
windows下使用GNU make命令报错的解决方法=> 错误信息:make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x ...
- ArcGIS API for Silverlight 调用WebService出现跨域访问报错的解决方法
原文:ArcGIS API for Silverlight 调用WebService出现跨域访问报错的解决方法 群里好几个朋友都提到过这样的问题,说他们在Silverlight中调用了WebServi ...
- 网站eurl.axd报错的解决方法
网站eurl.axd报错的解决方法 错误发生的原因是当ASP.NET检测到Web站点配置为使用ASP.NET 4.0,本地ASP.NET 4.0 的组件会传递一个不能扩展的 URL到ASP.NET的管 ...
- MySQL中遇到的几种报错及其解决方法
MySQL中遇到的几种报错及其解决方法 1.[Err] 1064 - You have an error in your SQL syntax; check the manual that corre ...
- vue项目初始化时npm run dev报错webpack-dev-server解决方法
vue项目初始化时npm run dev报错webpack-dev-server解决方法 原因:这是新版webpack存在的BUG,卸载现有的新版本webpack,装老版本就好webpack-dev- ...
- 如何自定义JSTL标签与SpringMVC 标签的属性中套JSTL标签报错的解决方法
如何自定义JSTL标签 1.创建一个类,从SimpleTagSupport继承 A) 通过继承可以获得当前JSP页面上的对象,如JspContext I) 实际上可以强转为PageContext II ...
随机推荐
- test,exec,match,replace方法区别 正则
这四种方法都是用来检测字符串是否包含某一子串或是否匹配否个正则表达式 test方法,匹配返回true,不匹配返回false match,匹配返回匹配到的数组(包含多次/g),匹配一次返回包含匹配子串的 ...
- 鸿蒙内核源码分析(静态链接篇) | 完整小项目看透静态链接过程 | 百篇博客分析OpenHarmony源码 | v54.01
百篇博客系列篇.本篇为: v54.xx 鸿蒙内核源码分析(静态链接篇) | 完整小项目看透静态链接过程 | 51.c.h.o 下图是一个可执行文件编译,链接的过程. 本篇将通过一个完整的小工程来阐述E ...
- 牛客练习赛89E-牛牛小数点【数论】
正题 题目链接:https://ac.nowcoder.com/acm/contest/11179/E 题目大意 定义\(f(x)\)表示\(\frac{1}{x}\)的混循环节长度(如果没有循环节就 ...
- P4491-[HAOI2018]染色【多项式,二项式反演】
正题 题目链接:https://www.luogu.com.cn/problem/P4491 题目大意 给\(n\)个物品染上\(m\)种颜色,若恰好有\(k\)个颜色的物品个数为\(S\)那么就会产 ...
- 双击tomcat8w.exe出现指定的服务未安装
进入tomcat bin 目录下 打开cmd 输入命令 service.bat install 进行服务安装. 双击tomcat8w.exe 就可以打开了.
- LR Socket接收超时TPS上不去解决方法
在一次做项目中,由于Socket协议接收的报文会有不定长度,基本每次都会有变化,在data.ws 接收buf1有固定长度,这是在接收的实时报文会有长度不一致的问题.这时LR默认会去与接收的报文的长度及 ...
- Sentry 监控 - Snuba 数据中台架构(Data Model 简介)
系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - 创建版本 快速使用 Docker 上手 Sentry-CLI - 30 秒上手 Source Maps Sentry For ...
- Java基础- 重写,重构和重载
重写也称为覆盖, 是指子类与父类的方法名相同但是可以有不同的权限(子类权限需大于父类),返回值(J2SE 5.0以后增加的功能,且子类的返回值必须是父类返回值的子类)或者方法实现. 重写体现了子类补充 ...
- Java 创建PDF打印小册子
概述 PDF打印小册子是指将PDF格式文档在打印成刊物前需要提前进行的页面排版,以便在打印后装订成册.下面以Java代码展示如何来实现.这里调用Free Spire.PDF for Java中的Pdf ...
- g++ 常用命令
g++ --help