On Fri, Nov 17, 2023 at 03:11:29PM +0100, Uwe Brauer wrote:

[...]
> It git I only obtain 
> 
> ,----
> | git merge 8b3b5c18a86bc20ee9
> | error: Merging is not possible because you have unmerged files.
> | hint: Fix them up in the work tree, and then use 'git add/rm <file>'
> | hint: as appropriate to mark resolution and make a commit.
> | fatal: Exiting because of an unresolved conflict.
> `----
> 
> So apart from the missing word *conflict* in the message 
> (which I would have appreciated since it explains better the problem)
> it seems only necessary to manually fix the conflicts and then run 
> 
> git commit -a -m "Merge resolved" 
> 
> Is this correct?

I'm afraid this situation might be not as straightforward as you think.

The message

> error: Merging is not possible because you have unmerged files

should be interpreted literally: Git did not even attempted a merge operation
because you have unmerged files in the index (and work tree).

(When there's a conflict during a merge, Git says exactly that, for each file
with the conflict(s).)

Quite possibly, you're in a state of a past attempted merge operation which
failed.

I would recommend to run

  git merge --abort

to revert the things to the pre-merge state (pre-*that*-merge state, that is)
and then try to run

  git merge $commit

again, and see.


As to resolving the conflicts, these days Git prominently hints at what to do
in the output it produces when you run `git status`.
Since in Git, a commit is created from the state constructed in the staging
area (or "the index", as it was called in the olden days), after resolving
conflicts in a file, you `git add` that file - "stage" its changes, and its
automatically marked as resolved.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231117174323.dmxsqgu362tlu2cb%40carbon.

Reply via email to