public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Guyot <tguyot@gmail.com>
To: "Sugiarto, Titania" <titania.sugiarto@rwth-aachen.de>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Feature that allows the user to merge only specific files/folders from another branch
Date: Tue, 24 Feb 2026 14:21:28 -0500	[thread overview]
Message-ID: <3f744aaa-23fd-45f7-9776-87036ec8ffc0@gmail.com> (raw)
In-Reply-To: <14775be9ed944bf684c3696e1a10f44d@rwth-aachen.de>

On 2026-02-24 08:44, Sugiarto, Titania wrote:
> 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


  reply	other threads:[~2026-02-24 19:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <532e9d58b905404fa625aa59104ce8f5@rwth-aachen.de>
2026-02-24 13:44 ` Feature that allows the user to merge only specific files/folders from another branch Sugiarto, Titania
2026-02-24 19:21   ` Thomas Guyot [this message]
2026-02-24 22:27   ` Junio C Hamano
2026-02-24 22:44   ` Kristoffer Haugsbakk
2026-02-25 21:56     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f744aaa-23fd-45f7-9776-87036ec8ffc0@gmail.com \
    --to=tguyot@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=titania.sugiarto@rwth-aachen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox