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

Re: need help with git show :1:...

From
Llayer <layer@known.net>
Date
Apr 8, 2009, 18:35 UTC
Message-ID
<7685.1239215733@relay.known.net>
In-Reply-To
<51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com>
Elijah Newren <newren@gmail.com> wrote:
Show 11 quoted lines
>> > How can I redo the merge for just this file?  Is that possible?  I
>> > think I'd definitely like to start over on *just this one file*.
>> 
>> Well, someone else probably knows a clever way to do this.  I don't,
>> but the following may help:
>> 
>> MERGE_REF=$(cat .git/MERGE_HEAD)
>> git show HEAD:src/c/sock.c > current-sock
>> git show $MERGE_REF:src/c/sock.c > other-sock
>> git show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock
>> git merge-file current-sock other-sock base-sock
Did you mean this?
  git merge-file current-sock base-sock other-sock
The man page seems to indicate that.
>> That'll redo the three way merge on src/c/sock.c (assuming no renames
>> or other special cases happened) and store the result in current-sock.
>>  You can then edit that file and when ready, move the result over
>> src/c/sock.c.
Thanks.  This is a big help.
Previous: Elijah NewrenNext: Elijah Newren
Message 7 of 8 in “need help with git show :1:...”
  1. layerApr 8, 2009
  2. Elijah NewrenApr 8, 2009
  3. layerApr 8, 2009
  4. Elijah NewrenApr 8, 2009
  5. layerApr 8, 2009
  6. Elijah NewrenApr 8, 2009
  7. layerApr 8, 2009
  8. Elijah NewrenApr 8, 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.