Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stuck at "A merge operation in progress"

Steps

  • In Visual Studio
  • Pulled from remote repo
  • 1 merge conflict
  • Merged manually, clicked 'Accept merge'

Result

  • Message: "A merge operation is in progress in the ... repository. Commit your changes to complete the merge operation."
  • However, there is nothing to commit: There are 0 pending changes, no actions apart from Abort seem to be possible.

Screenshot: https://pbs.twimg.com/media/DBOeRIiXsAEbnLP.jpg

Context

  • Remote git repo is hosted in Visual Studio Team Services
  • Visual Studio 2017 with all updates
like image 218
Bernard Vander Beken Avatar asked Jun 01 '17 09:06

Bernard Vander Beken


People also ask

How do I stop a merge in progress?

Use git-reset or git merge --abort to cancel a merge that had conflicts. Please note that all the changes will be reset, and this operation cannot be reverted, so make sure to commit or git-stash all your changes before you start a merge.

How do I undo a failed merge?

On the command line, a simple "git merge --abort" will do this for you. In case you've made a mistake while resolving a conflict and realize this only after completing the merge, you can still easily undo it: just roll back to the commit before the merge happened with "git reset --hard " and start over again.

How do I abort a merge in IntelliJ?

In the latest versions of IntelliJ (and I suppose other JetBrains products) there is a new option in the "Git branches" menu (bottom right of the screen) conveniently named "Abort Merge"... This also works for most things with conflicts like reverts that result in needing a merge.


1 Answers

I had a very similar problem with one of my projects which gave me the same TFS message in Visual Studio 2017. I was also using git. In my case I needed to manually add a comment to the commit before posting the merge. Since I had to manually merge the conflicts, a comment was needed rather than the auto-populated message that takes place on a merge without conflicts.

I'm well aware that commits need comments but if I recall correctly, VS 2015 would auto-populate the comment on a merge, even if you manually fixed any merge issues. Regardless, in VS 2017 you will need to add a commit comment when there are resolved conflicts.

like image 121
RLH Avatar answered Sep 29 '22 19:09

RLH