push to origin/master was rejected错误解决方案 转载 https://blog.csdn.net/a137151062/article/details/788208

idea中,发布项目到OSChina的Git中,当时按照这样的流程添加Git,然后push,提示:push to origin/master war rejected"。


解决方案如下:

1.切换到自己项目所在的目录,右键选择GIT BASH Here,Idea中可使用Alt+F12

2.在terminl窗口中依次输入命令:

git pull

git pull origin master

git pull origin master --allow-unrelated-histories

3.在idea中重新push自己的项目,成功!!!

你可能感兴趣的:(push to origin/master was rejected错误解决方案 转载 https://blog.csdn.net/a137151062/article/details/788208)