Hi Michael,

On Saturday, July 8, 2017 at 3:03:42 AM UTC+2, Michael Gersten wrote:
> So I did a merge, edited the conflicts, and committed the result. Looking 
> over the commit, I saw that I missed a conflict marker. 
> No bigger. "git reset head^", fix it up, and re-commit, right?

Not really, you could have fixed it up right away (without resetting), and 
"re-commit" with:

(*1*) $ git commit --amend --no-edit

... which is what you actually wanted to do anyway, amend the last (merge) 
commit ;)

No, for some reason, that wants to commit a normal commit, not a merge 
> commit. 
> The second parent is missing. 

This is as expected -- with your `git reset HEAD^` you dropped your last 
(merge) commit, returning to previous commit but keeping the uncommited 
changes. By "re-commit", I assume you mean plain `git commit`, and that 
makes a regular, single parent commit, not a merge commit -- Git has no 
idea of your previous merge commit at this point, nor that you want to make 
one now.

How do I make it come back?

In your current situation, you can reset again to drop the unwanted 
non-merge commit, and then manually create "MERGE_HEAD" file inside your 
".git" folder, containing the hash of the second parent you want your merge 
commit to contain, for example:

(*2*) $ git reset --soft HEAD^
    $ echo *second-parent-sha1* >.git/MERGE_HEAD

With that file present and set, doing `git commit` will make a merge 
commit, setting the second parent as you want it.

But in general case, doing (*1*) as explained above and avoiding 
unnecessary hassle seems more preferable :)


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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to