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

Re: re-running merge on a single file

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Mar 11, 2010, 20:29 UTC
Message-ID
<201003112129.52596.markus.heidelberg@web.de>
In-Reply-To
<a038bef51003111054n5bcecd2eud531dcc80509f952@mail.gmail.com>
Chris Packham, 2010-03-11 19:54:
Show 6 quoted lines
> In other cases I'm actually thinking
> that it'd be easier to ask git to try the merge again on that one
> file. I can ask git difftool to show me the pre-merge differences with
> 'git difftool master..vendor <file>' but what I'd really like to do is
> ask git mergetool to do something similar so I can re-do my manual
> merging.

Not mergetool, but checkout: git checkout --merge -- file

Show 6 quoted lines
> Alternatively I could manually drive and external merge tool like
> kdiff3 if I had a recipe for getting the common ancestor revision.
> Something like
> 
> git checkout <magic pathspec> -- file
> mv file file.base
git cat-file blob :1:file > file.base
> 
> git checkout master -- file
git checkout --ours -- file
> mv file file.ours

or git cat-file blob :2:file > file.ours

> git checkout vendor -- file
git checkout --theirs -- file
> mv file file.theirs

or git cat-file blob :3:file > file.theirs

> kdiff3 file.base file.ours file.theirs -o file
See the manpages of git-checkout and git-merge for these syntaxes.
Markus
Previous: Chris PackhamNext: Chris Packham
Message 3 of 14 in “re-running merge on a single file”
  1. Chris PackhamMar 11, 2010
  2. Chris PackhamMar 11, 2010
  3. Markus HeidelbergMar 11, 2010
  4. Chris PackhamMar 11, 2010
  5. Jakub NarebskiMar 11, 2010
  6. Chris PackhamMar 12, 2010
  7. Johannes SixtMar 12, 2010
  8. Junio C HamanoMar 12, 2010
  9. Chris PackhamMar 12, 2010
  10. Chris PackhamMar 12, 2010
  11. Junio C HamanoMar 12, 2010
  12. Chris PackhamMar 12, 2010
  13. Kris ShannonMar 14, 2010
  14. Jakub NarebskiMar 12, 2010

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.