0

I use a private repository on Bitbucket as a convenient way of syncing a project (C source code) across several machines I work on; I am the only developer working on the project.

When working on a remote machine (I ssh to it) and trying to git pull I get the following error message:

"You are in the middle of a conflicted merge."

It exits without doing the fast forward merge.

How do I go about resolving this? How do I force a merge on this machine?

I am not averse to trying to reset to an earlier state.

haziz
  • 11,199
  • 14
  • 48
  • 69

2 Answers2

2

Apparently you are in the middle of a prior merge attempt that had some conflicts. Your first step would be to understand what happened and where you are. Do

git status

This will show you what files are conflicted. Once you understand what happened you can decide to resolve the conflicts (see the link provided by @rcdmk). If, instead, you decide you just want to blow away the prior merge, then you can do:

git merge --abort

But you'll want to be very careful with this as stuff will disappear. You will be okay if the remote has everything you want; so follow up with:

git pull
GoZoner
  • 59,252
  • 19
  • 87
  • 137
1

When you face merge conflicts, there's a lot of options to follow, but you can consult the Git manual on this topic for a help. Also, a similar question has been asked here: How to resolve merge conflicts in Git?

Community
  • 1
  • 1
Ricardo Souza
  • 14,681
  • 6
  • 33
  • 64