IDEA使用GIT push的时候提示“push to origin/master was rejected”解决方案

push to origin/master was rejected错误解决方案

解决方案如下:

切换到自己项目所在的目录,打开终端窗口,执行如下命令:

git add .

git commit -m ‘init’

git pull

git pull origin master

git pull origin master allow-unrelated-histories

命令执行完毕后,

git push origin master

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

滚动至顶部