IDEA创建项目push到git上报错“Push rejected: Push to origin/master was rejected”

Push rejected: Push to origin/master was rejected

解决方案如下:

1.“Show in Explorer”切换到自己项目所在的目录,Git Bash Here

2.依次输入命令:

git pull

git pull origin master

#[ --allow-unrelated-histories]是告诉系统我允许合并不相关历史的内容
git pull origin master --allow-unrelated-histories

3.在idea中重新push自己的项目,搞定!!!

发布了86 篇原创文章 · 获赞 110 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/libra_ts/article/details/84590874