refusing to merge unrelated histories解决

Push rejected: Push to origin/master was rejected


关键代码:

git pull origin master --allow-unrelated-histories

但是要注意:origin不是一个固定的写法
例如:我在idea中配置了两个远程仓库,如图:
idea中配置的两个远程仓库

这个时候依次执行:

git pull github master --allow-unrelated-histories
git pull  mayun master --allow-unrelated-histories

再尝试push代码,就成功了!

发布了39 篇原创文章 · 获赞 13 · 访问量 2317

猜你喜欢

转载自blog.csdn.net/weixin_45612794/article/details/103572065