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

Re: merge, keeping the remote as a new file?

From
Jeff King <peff@peff.net>
Date
Mar 2, 2009, 04:11 UTC
Message-ID
<20090302041113.GA3094@coredump.intra.peff.net>
In-Reply-To
<81bfc67a0903011616w32ebdad9ofc096f5d1fd3174a@mail.gmail.com>
On Sun, Mar 01, 2009 at 07:16:10PM -0500, Caleb Cushing wrote:
>  I have an unmerged file... the resolution I'd like to have is
> checkout the local one for the current file name. take the remote
> version and give it a new file name. what's the best way to do that?
I would use:
  $ git show :2:file >file
  $ git show :3:file >newfile
  $ git add file newfile

You can do the first with "git checkout --ours", but I don't think there is a way with "checkout" to say "checkout this path, but put it in a different place".

-Peff
Previous: Caleb CushingNext: Charles Bailey
Message 2 of 7 in “merge, keeping the remote as a new file?”
  1. Caleb CushingMar 2, 2009
  2. Jeff KingMar 2, 2009
  3. Charles BaileyMar 2, 2009
  4. Jeff KingMar 2, 2009
  5. Björn SteinbrinkMar 2, 2009
  6. Jeff KingMar 2, 2009
  7. Jay SoffianMar 2, 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.