今天在使用git将idea下编辑好的项目提交到码云上出错:
push to origin/master was rejected
然后再本地仓库git pull origin master --allow-unrelated-histories的时候,发现:
$ git pull origin master --allow-unrelated-histories
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
然后git status,发现:
$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add <file>..." to mark resolution)
both added: README.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
.idea/dataSources.local.xml
.idea/workspace.xml
out/
target/
no changes added to commit (use "git add" and/or "git commit -a")
网上找了很多方法,始终解决不了,总的来说就是项目有冲突的地方,可是我根本没在远程仓库中做任何代码的填写,没办法,我就讲冲突文件git add -u了一下,然后再git commit,结果就能push上去了。