git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how do I resolve this merge manually + mergetool bug

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2009, 06:31 UTC
Message-ID
<7vbpssmjm9.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<81bfc67a0902232204y7a1e9a91x6cbf751319664734@mail.gmail.com>
Caleb Cushing <xenoterracide@gmail.com> writes:
Show 6 quoted lines
> #       unmerged:   profiles/package.mask
>
> on the remote package.mask is a file locally it is a directory.
> ...
> git rm :3:profiles/package.mask
> fatal: pathspec ':3:profiles/package.mask' did not match any files
The answer most likely is this but don't do this just yet:
    $ git rm profiles/package.mask

With this, you are saying "For the path profiles/package.mask, the correct resolution is not to have it". There is no room for the stage number to get into the picture when you are talking about the final result.

But I am suspecting that this is because you moved it to somewhere (perhaps to profiles/package.mask/frotz) while the remote side kept it intact or modified it in place. If that is the case, and if the remote side made an in-place change, you would want to port the change over to the path you moved the contents to before you actually remove it, so before running the above "git rm", I would do something like.

    $ git cat-file blob :1:profiles/package.mask >original
    $ git cat-file blob :3:profiles/package.mask >theirs
    $ git cat-file blob profiles/package.mask/frotz >mine
    $ git merge-file mine original theirs
    $ diff -u profiles/package.mask/frotz mine ;# eyeball the merge result
    $ cat mine >profiles/package.mask/frotz
and then finally conclude the merge with:
    $ git rm profiles/package.mask
    $ git add profiles/package.mask/frotz

But if the remote side did not change anything (i.e. original == theirs), then you do not have to do the file-level merge to update the contents you moved to a different path.

Previous: Caleb CushingNext: Caleb Cushing
Message 2 of 8 in “how do I resolve this merge manually + mergetool bug”
  1. Caleb CushingFeb 24, 2009
  2. Junio C HamanoFeb 24, 2009
  3. Caleb CushingFeb 24, 2009
  4. Junio C HamanoFeb 24, 2009
  5. Caleb CushingFeb 24, 2009
  6. Charles BaileyFeb 24, 2009
  7. Caleb CushingFeb 24, 2009
  8. Charles BaileyFeb 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.