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

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

    • 问题描述
    • 解决方法

问题描述

idea开发中,需要将项目发布到gitee上,在gitee上创建仓库后,通过idea中git推送项目代码提示: push to origin/master was rejected
Idea中git push to origin/master was rejected错误解决方案_第1张图片

解决方法

gitee创建仓库时创建了README.md文件,本地仓库和远程仓库还未进行文件关联,需要将文件关联后提交

#在terminl窗口中依次输入命令:
git pull
 
git pull origin master
 
git pull origin master --allow-unrelated-histories

git push -u origin master -f

你可能感兴趣的:(intellij-idea,git,java)