
push to origin/master was rejected错误解决方案
发布日期:2021-05-08 23:20:39
浏览次数:21
分类:博客文章
本文共 1421 字,大约阅读时间需要 4 分钟。
push to origin/master was rejected错误解决方案
原因
初始化项目时,远程仓库自动建了某些文件,而本地仓库与远程仓库尚没有进行文件关联,因此需要将两个仓库的文件进行关联后提交。
操作步骤
切换到自己项目所在的目录
1.右键选择GIT BASH Here,Idea中可使用Alt+F12
2.在terminl窗口中依次输入命令:
git pull
git pull origin master
git pull origin master --allow-unrelated-histories
$ git pullwarning: no common commitsremote: Enumerating objects: 4, done.remote: Counting objects: 100% (4/4), done.remote: Compressing objects: 100% (4/4), done.remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0Unpacking objects: 100% (4/4), done.From gitee.com:courage129/mybatis * [new branch] master -> origin/masterThere is no tracking information for the current branch.Please specify which branch you want to merge with.See git-pull(1) for details. git pullIf you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master$ git pull origin masterFrom gitee.com:courage129/mybatis * branch master -> FETCH_HEADfatal: refusing to merge unrelated histories$ git pull origin master --allow-unrelated-historiesFrom gitee.com:courage129/mybatis * branch master -> FETCH_HEADerror: Your local changes to the following files would be overwritten by merge: .idea/compiler.xml .idea/encodings.xml .idea/inspectionProfiles/Project_Default.xml .idea/misc.xml .idea/workspace.xml Mybatis.iml
3.在idea中重新push自己的项目,成功!!
发表评论
最新留言
路过,博主的博客真漂亮。。
[***.116.15.85]2025年03月25日 03时26分29秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
等和的分隔子集(DP)
2019-03-06
基础练习 十六进制转八进制(模拟)
2019-03-06
L - Large Division (大数, 同余)
2019-03-06
39. Combination Sum
2019-03-06
41. First Missing Positive
2019-03-06
80. Remove Duplicates from Sorted Array II
2019-03-06
83. Remove Duplicates from Sorted List
2019-03-06
410. Split Array Largest Sum
2019-03-06
开源项目在闲鱼、b 站上被倒卖?这是什么骚操作?
2019-03-06
Vue3发布半年我不学,摸鱼爽歪歪,哎~就是玩儿
2019-03-06
《实战java高并发程序设计》源码整理及读书笔记
2019-03-06
Java开源博客My-Blog(SpringBoot+Docker)系列文章
2019-03-06
程序员视角:鹿晗公布恋情是如何把微博搞炸的?
2019-03-06
【JavaScript】动态原型模式创建对象 ||为何不能用字面量创建原型对象?
2019-03-06
Linux应用-线程操作
2019-03-06
多态体验,和探索爷爷类指针的多态性
2019-03-06
系统编程-进程间通信-无名管道
2019-03-06
记2020年初对SimpleGUI源码的阅读成果
2019-03-06