git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Vlad Didenko <vdidenko@Getcollc.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Exclude a directory while merging
Date: Thu, 30 Jul 2009 16:42:24 +0400	[thread overview]
Message-ID: <20090730124224.GC27178@dpotapov.dyndns.org> (raw)
In-Reply-To: <C696F858.CEB0%vdidenko@Getcollc.com>

Hi,

On Thu, Jul 30, 2009 at 07:12:24AM -0500, Vlad Didenko wrote:
> 
> Is there an easy way to exclude a directory from a merge operation.

You cannot merge some directories but not other, but you always can
discard any changes during merge.

> Specifically:
> 
> We have a "master" branch. We also have an "other" branch. There is a
> directory XYZ in the other branch which is not in the master. I need to
> merge everything but XYZ into master. Something like that:
> 
> git checkout master
> git merge other --exclude XYZ

I have not tried, but it should be like this:

git merge --no-commit other
git checkout HEAD XYZ  # or 'git rm XYZ' if XYZ does not exist on master
git commit

NOTE: Git will consider all changes including the directory XYZ as
already merged into master and will not try to merge it later (unless
there are some other changes to that directory).

Dmitry

      reply	other threads:[~2009-07-30 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 12:12 Exclude a directory while merging Vlad Didenko
2009-07-30 12:42 ` Dmitry Potapov [this message]

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=20090730124224.GC27178@dpotapov.dyndns.org \
    --to=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=vdidenko@Getcollc.com \
    /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;
as well as URLs for NNTP newsgroup(s).