我有麻烦来解决我的工作副本上的一个问题:早些时候我提取并自动合并了几个文件,然后它们出现在我没有提交的分阶段区域。我现在通过git checkout -- my/file
恢复了文件中的更改,当天晚些时候,我想再做一次拉,但它做不到,我得到了一个错误,比如:
$ git pull
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
我怎样才能解决这个问题?我不想在这个分支上做任何事!我还得到:
$ git status
On branch dev
Your branch and 'origin/dev' have diverged,
and have 3 and 4 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Untracked files:
(use "git add <file>..." to include in what will be committed)
发布于 2020-05-07 05:55:35
首先,git merge --quit
(Git 2.23+)应该有助于摆脱正在进行的合并。
其次,git pull --rebase
应该有助于在更新的origin/dev
之上重放本地提交。
那你就可以推了。
OP BitFreak使其工作(see comment)与:
git push --abort
git pull --rebase
https://stackoverflow.com/questions/61647654
复制相似问题