1. 程式人生 > >git提交到gitee(碼雲)出錯

git提交到gitee(碼雲)出錯

今天在使用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上去了。