Updates were rejected because the remote contains work that you do

发布时间 2023-08-10 21:47:23作者: 见怪见外

今天在idea里面创建了一个项目,然后又在gitee中创建了一个项目,然后我打算把idea上面的那个小demo上传到我的gitee仓库中,结果一直报 Updates were rejected because the remote contains work that you do这样的错误,其中原因好像是我的仓库中包含了我的本地没有的文件,然后上网搜索了一下,在idea中的终端执行下面的代码

 git pull origin master --allow-unrelated-histories

表示忽略不一样的历史记录,具体参考

git 报错:Updates were rejected because the remote contains work that you do问题_tjh1998的博客-CSDN博客