当前位置:   article > 正文

您尚未完成合并(MERGE_HEAD存在)_you have not concluded your merge (merge head exis

you have not concluded your merge (merge head exists

本文翻译自:You have not concluded your merge (MERGE_HEAD exists)

I made a branch called 'f' and did a checkout to master. 我做了一个名为“ f”的分支,并进行了结帐。 When I tried the git pull command I got this message: 当我尝试使用git pull命令时,收到以下消息:

  1. You have not concluded your merge (MERGE_HEAD exists).
  2. Please, commit your changes before you can merge.

When I try the git status , it gave me the following: 当我尝试git status ,它给了我以下内容:

  1. On branch master
  2. # Your branch and 'origin/master' have diverged,
  3. # and have 1 and 13 different commit(s) each, respectively.
  4. #
  5. # Changes to be committed:
  6. #
  7. # modified: app/assets/images/backward.png
  8. # modified: app/assets/images/forward.png
  9. # new file: app/assets/images/index_background.jpg
  10. # new file: app/assets/images/loading.gif
  11. # modified: app/assets/images/pause.png
  12. # modified: app/assets/images/play.png
  13. # new file: app/assets/javascripts/jquery-ui-bootstrap.js
  14. # new file: app/assets/stylesheets/jquery-ui-bootstrap.css
  15. # modified: app/controllers/friends_controller.rb
  16. # modified: app/controllers/plays_controller.rb
  17. # modified: app/mailers/invite_friends_mailer.rb
  18. # modified: app/mailers/send_plays_mailer.rb
  19. # modified: app/mailers/shot_chart_mailer.rb
  20. # modified: app/views/friends/show_plays.html.erb
  21. # modified: app/views/layouts/application.html.erb
  22. # modified: app/views/plays/_inbox_table.html.erb
  23. # modified: app/views/plays/show.html.erb
  24. # modified: app/views/welcome/contact_form.html.erb
  25. # modified: app/views/welcome/index.html.erb
  26. # modified: log/development.log
  27. # modified: log/restclient.log
  28. # new file: tmp/cache/assets/C1A/C00/sprockets%2Fb7901e0813446f810e560158a1a97066
  29. # modified: tmp/cache/assets/C64/930/sprockets%2F65aa1510292214f4fd1342280d521e4c
  30. # new file: tmp/cache/assets/C73/C40/sprockets%2F96912377b93498914dd04bc69fa98585
  31. # new file: tmp/cache/assets/CA9/090/sprockets%2Fa71992733a432421e67e03ff1bd441d8
  32. # new file: tmp/cache/assets/CCD/7E0/sprockets%2F47125c2ebd0e8b29b6511b7b961152a1
  33. # modified: tmp/cache/assets/CD5/DD0/sprockets%2F59d317902de6e0f68689899259caff26
  34. # modified: tmp/cache/assets/CE3/080/sprockets%2F5c3b516e854760f14eda2395c4ff2581
  35. # new file: tmp/cache/assets/CED/B20/sprockets%2F423772fde44ab6f6f861639ee71444c4
  36. # new file: tmp/cache/assets/D0C/E10/sprockets%2F8d1f4b30c6be13017565fe1b697156ce
  37. # new file: tmp/cache/assets/D12/290/sprockets%2F93ae21f3cdd5e24444ae4651913fd875
  38. # new file: tmp/cache/assets/D13/FC0/sprockets%2F57aad34b9d3c9e225205237dac9b1999
  39. # new file: tmp/cache/assets/D1D/DE0/sprockets%2F5840ff4283f6545f472be8e10ce67bb8
  40. # new file: tmp/cache/assets/D23/BD0/sprockets%2F439d5dedcc8c54560881edb9f0456819
  41. # new file: tmp/cache/assets/D24/570/sprockets%2Fb449db428fc674796e18b7a419924afe
  42. # new file: tmp/cache/assets/D28/480/sprockets%2F9aeec798a04544e478806ffe57e66a51
  43. # new file: tmp/cache/assets/D3A/ED0/sprockets%2Fcd959cbf710b366c145747eb3c062bb4
  44. # new file: tmp/cache/assets/D3C/060/sprockets%2F363ac7c9208d3bb5d7047f11c159d7ce
  45. # new file: tmp/cache/assets/D48/D00/sprockets%2Fe23c97b8996e7b5567a3080c285aaccb
  46. # new file: tmp/cache/assets/D6A/900/sprockets%2Fa5cece9476b21aa4d5f46911ca96c450
  47. # new file: tmp/cache/assets/D6C/510/sprockets%2Fb086a020de3c258cb1c67dfc9c67d546
  48. # new file: tmp/cache/assets/D70/F30/sprockets%2Facf9a6348722adf1ee7abbb695603078
  49. # new file: tmp/cache/assets/DA3/4A0/sprockets%2F69c26d0a9ca8ce383e20897cefe05aa4
  50. # new file: tmp/cache/assets/DA7/2F0/sprockets%2F61da396fb86c5ecd844a2d83ac759b4b
  51. # new file: tmp/cache/assets/DB9/C80/sprockets%2F876fbfb9685b2b8ea476fa3c67ae498b
  52. # new file: tmp/cache/assets/DBD/7A0/sprockets%2F3640ea84a1dfaf6f91a01d1d6fbe223d
  53. # new file: tmp/cache/assets/DC1/8D0/sprockets%2Fe5ee1f1cfba2144ec00b1dcd6773e691
  54. # new file: tmp/cache/assets/DCC/E60/sprockets%2Fd6a95f601456c93ff9a1bb70dea3dfc0
  55. # new file: tmp/cache/assets/DF1/130/sprockets%2Fcda4825bb42c91e2d1f1ea7b2b958bda
  56. # new file: tmp/cache/assets/E23/DE0/sprockets%2Fb1acc25c28cd1fabafbec99d169163d3
  57. # new file: tmp/cache/assets/E23/FD0/sprockets%2Fea3dbcd1f341008ef8be67b1ccc5a9c5
  58. # modified: tmp/cache/assets/E4E/AD0/sprockets%2Fb930f45cfe7c6a8d0efcada3013cc4bc
  59. # new file: tmp/cache/assets/E63/7D0/sprockets%2F77de495a665c3ebcb47befecd07baae6
  60. # modified: tmp/pids/server.pid
  61. #
  62. # Untracked files:
  63. # (use "git add <file>..." to include in what will be committed)
  64. #
  65. # Coachbase/
  66. # log/development.log.orig
  67. # log/restclient.log.orig

What should I do? 我该怎么办?


#1楼

参考:https://stackoom.com/question/mrgR/您尚未完成合并-MERGE-HEAD存在


#2楼

OK. 好。 The problem is your previous pull failed to merge automatically and went to conflict state. 问题是您先前的拉动未能自动合并并进入冲突状态。 And the conflict wasn't resolved properly before the next pull. 在下一次拉动之前,冲突没有得到正确解决。

  1. Undo the merge and pull again. 撤消合并并再次拉。

    To undo a merge: 撤消合并:

    git merge --abort [Since git version 1.7.4] git merge --abort [从git版本1.7.4开始]

    git reset --merge [prior git versions] git reset --merge [以前的git版本]

  2. Resolve the conflict. 解决冲突。

  3. Don't forget to add and commit the merge. 不要忘记添加并提交合并。

  4. git pull now should work fine. git pull现在应该可以正常工作。


#3楼

Best approach is to undo the merge and perform the merge again. 最好的方法是撤消合并,然后再次执行合并。 Often you get the order of things messed up. 通常,您会弄乱事情的顺序。 Try and fix the conflicts and get yourself into a mess. 尝试解决冲突,使自己陷入混乱。

So undo do it and merge again. 因此,撤消操作,然后再次合并。

Make sure that you have the appropriate diff tools setup for your environment. 确保您具有适合您的环境的差异工具设置。 I am on a mac and use DIFFMERGE. 我在Mac上使用DIFFMERGE。 I think DIFFMERGE is available for all environments. 我认为DIFFMERGE适用于所有环境。 Instructions are here: Install DIFF Merge on a MAC 说明在这里: 在MAC上安装DIFF合并

I have this helpful resolving my conflicts: Git Basic-Merge-Conflicts 我对解决冲突有帮助: Git Basic-Merge-Conflicts


#4楼

If you are sure that you already resolved all merge conflicts: 如果您确定已经解决了所有合并冲突:

rm -rf .git/MERGE*

And the error will disappear. 错误将消失。


#5楼

I think it's worth mentioning that there are numerous scenarios in which the message You have not concluded your merge (MERGE_HEAD exists) could occur, because many people have probably arrived at this page after searching for said message. 我认为值得一提的是,在许多情况下,可能会出现消息“ You have not concluded your merge (MERGE_HEAD exists) ,因为许多人可能在搜索了该消息后到达了此页面。 The resolution will depend on how you got there. 分辨率将取决于您的到达方式。

git status is always a useful starting point. git status始终是一个有用的起点。

If you've already merged the contents to your satisfaction and are still getting this message, it could be as simple as doing 如果您已经合并了内容并使您满意,并且仍然收到此消息,则可以像执行操作一样简单

  1. git add file
  2. git commit

But again, it really depends on the situation. 但是,这实际上取决于情况。 It's a good idea to understand the basics before attempting anything (same link Terence posted): Git - Basic Merge Conflicts 在尝试任何操作之前最好先了解基础知识(与Terence发布相同的链接): Git-基本合并冲突


#6楼

This worked for me: 这为我工作:

  1. git log
  2. `git reset --hard <089810b5be5e907ad9e3b01f>`
  3. git pull
  4. git status
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/606602
推荐阅读
相关标签
  

闽ICP备14008679号