首先是会出现远程仓库和本地仓库不匹配的问题
所以在idea中进行正常的push操作会报错 push rejected
此时通过如下 命令上传查看具体错误
git push https://github.com/github名字 / 仓库名字.git' master
此时错误应该是
To https://github.com/***/*** .git
! [rejected] master -> master (fetch first)
error: 推送一些引用到 'https://github.com/ github名字 / 仓库名字.git'
然后执行如下两条命令
git pull --allow-unrelated-histor
git branch --set-upstream-to=origin/master master
最后再执行
git push https://github.com/github名字 / 仓库名字.git' master
就能够成功了