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

Re: Git merge selective files

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jun 9, 2009, 19:39 UTC
Message-ID
<32541b130906091239x1c92a1caxd260983a66e8025f@mail.gmail.com>
In-Reply-To
<4A2EB575.8050107@workspacewhiz.com>
On Tue, Jun 9, 2009 at 3:18 PM, Joshua Jensen<jjensen@workspacewhiz.com> wrote:
Show 9 quoted lines
> On Tue, Jun 9, 2009 at 5:53 AM, joe higton<draxil@gmail.com> wrote:
>>     I want to merge changes from a branch but only to one file, I
>> don't want to pick up the changes from other files. I've scoured
>> google and the docs a bit but I can't find anything useful. Is this
>> possible?
>
> I like this one:
>
> http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/

Careful... that *replaces* the files with the ones from the branch. It doesn't *merge* them. Although that may be exactly what you want.

And the "'merge --squash' and don't commit the changes you don't want" option looks okay to me too.

Avery
Previous: Alex RiesenNext: Junio C Hamano
Message 4 of 5 in “Git merge selective files”
  1. joe higtonJun 9, 2009
  2. Avery PennarunJun 9, 2009
  3. Alex RiesenJun 9, 2009
  4. Avery PennarunJun 9, 2009
  5. Junio C HamanoJun 9, 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.