idea中新建git项目push rejected失败master -> master (fetch first) error: failed to push some refs to异常
发布日期:2021-06-30 21:31:30
浏览次数:2
分类:技术文章
本文共 1518 字,大约阅读时间需要 5 分钟。
场景
新建项目关联gitlab后进行push提交出错
Updates were rejected because the remote contains work that you doerror: failed to push some refs to 'git@xxxxxx'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因分析
- 拒绝原因是在gitlab或github上创建项目时创建README.md,此时远程版本与本地不一只,无法直接提交。
- 需要对远程版本和本地版本进行合并,保证本地为最新版本即可。
解决方案
本地拉取远程版本进行合并即可
git pull --rebase origin master
lizzdeMacBook-Pro:lizz-boot-parent lizz$ git pull --rebase origin masterwarning: no common commitsremote: Enumerating objects: 3, done.remote: Counting objects: 100% (3/3), done.remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0Unpacking objects: 100% (3/3), done.From https://github.com/lizz365/lizz-boot-parent.git * branch master -> FETCH_HEAD * [new branch] master -> origin/masterFirst, rewinding head to replay your work on top of it...Applying: xxxxxxx
效果
提交成功
lizzdeMacBook-Pro:lizz-boot-parent lizz$ git push origin masterEnumerating objects: 4, done.Counting objects: 100% (4/4), done.Delta compression using up to 4 threadsCompressing objects: 100% (3/3), done.Writing objects: 100% (3/3), 1.26 KiB | 1.26 MiB/s, done.Total 3 (delta 0), reused 0 (delta 0)To https://github.com/lizz365/lizz-boot-parent.git 240367d..9adbf75 master -> master
转载地址:https://lizz6.blog.csdn.net/article/details/109550237 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月06日 11时44分25秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
WebService的简单案例记录(Java)
2019-04-30
Html利用PHP与MySQL交互
2019-04-30
dos简单命令
2019-04-30
mysql的安装与卸载与Navicat远程连接
2019-04-30
java实现稀疏数组及将稀疏数组存入硬盘中
2019-04-30
2021-05-18
2019-04-30
Flutter 使用插件打开相册、相机
2019-04-30
libuv实现tcp代理服务器
2019-04-30
libuv实现ping包发送和接收
2019-04-30
基础架构系列篇-CENTOS7安装NGINX
2019-04-30
基础架构系列篇-系统centos7安装docker+COMPOSE
2019-04-30
基础架构系列篇-NGINX部署VUE
2019-04-30
基础架构系列篇-系统centos7安装kafka
2019-04-30
基础架构系列篇-系统centos7中docker安装分布式文件存储服务minio
2019-04-30
知识点记录-java判断系统是linux或windows
2019-04-30
知识点记录-springboot静态资源映射路径
2019-04-30
微服务springcloud2系列篇-配置与注册nacos组件
2019-04-30
用户权限设计-基于RBAC模型
2019-04-30
微服务springcloud2系列篇-网关GATEWAY跨域问题
2019-04-30
软件质量的8个特性
2019-04-30