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

Re: Feature that allows the user to merge only specific files/folders from another branch

From
Thomas Guyot <tguyot@gmail.com>
Date
Feb 24, 2026, 19:21 UTC
Message-ID
<3f744aaa-23fd-45f7-9776-87036ec8ffc0@gmail.com>
In-Reply-To
<14775be9ed944bf684c3696e1a10f44d@rwth-aachen.de>
On 2026-02-24 08:44, Sugiarto, Titania wrote:
Show 6 quoted lines
> Hi,
> 
> I have a suggestion for Git, which includes a feature that allows the user to merge (I want to highlight merge here, not replace) specific files/folders from another branch.
> I feel like a lot of users have spoken about this online but up until now, there hasn't been an update regarding such feature.
> 
> Might be worthwhile to consider?
Hi Titania,
I believe what you are looking for is already easily doable with:
   git merge --no-commit

Then you can revert some of the changes you don't want in the index before running this to complete the merge:

   git merge --continue

Note that subsequent merges from that branch would not include the changes you skipped, that's the core concept of merging and you can't avoid it. That said you can also cherry-pick specific commits, also with the same --no-edit flag to allow editing the cherry pick.

Since cherry-picking is centered around individual commits, doing that for all commits of a forked branch might be difficult. It appears there a -m/--mainline switch in cherry-pick to allow that but I have never used it. You will have to experiment yourself if this is what you want.

Regards,

-- Thomas

Previous: Sugiarto, TitaniaNext: Junio C Hamano
Message 2 of 5 in “Feature that allows the user to merge only specific files/folders from another branch”
  1. Sugiarto, TitaniaFeb 24, 2026
  2. Thomas GuyotFeb 24, 2026
  3. Junio C HamanoFeb 24, 2026
  4. Kristoffer HaugsbakkFeb 24, 2026
  5. Junio C HamanoFeb 25, 2026

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.