git 合并后的问题:无法拉取,因为未完成合并且没有暂存文件
Problem after git merge: unable to pull because unfinished merge and no staged files
我已经在 GitHub 上合并了一个分支到 master,之后想在本地进行 git 拉取。当我执行 git pull 时,它要求我提交更改,所以我添加了文件并提交了。
但是发生了一些事情,虽然合并已经完成,但我还是卡在了合并的中间。我有一个空的暂存区,当我尝试执行 git 拉动时,出现此错误:
❯ 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 pull --force
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
并且在我在控制台中用我拥有的分支名称写入的那一行
master merge
谁能告诉我这里发生了什么以及如何解决这个问题?
谢谢
你试过git merge --abort
再试拉吗?
来自www.git-tower.com about merge-conflicts:
You should always keep in mind that you can return to the state before you started the merge at any time. This should give you the confidence that you can't break anything. On the command line, a simple git merge --abort
will do this for you.
另见 You have not concluded your merge (MERGE_HEAD exists)
我已经在 GitHub 上合并了一个分支到 master,之后想在本地进行 git 拉取。当我执行 git pull 时,它要求我提交更改,所以我添加了文件并提交了。
但是发生了一些事情,虽然合并已经完成,但我还是卡在了合并的中间。我有一个空的暂存区,当我尝试执行 git 拉动时,出现此错误:
❯ 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 pull --force
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
并且在我在控制台中用我拥有的分支名称写入的那一行
master merge
谁能告诉我这里发生了什么以及如何解决这个问题? 谢谢
你试过git merge --abort
再试拉吗?
来自www.git-tower.com about merge-conflicts:
You should always keep in mind that you can return to the state before you started the merge at any time. This should give you the confidence that you can't break anything. On the command line, a simple
git merge --abort
will do this for you.
另见 You have not concluded your merge (MERGE_HEAD exists)