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

Re: Exclude a directory while merging

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Jul 30, 2009, 12:42 UTC
Message-ID
<20090730124224.GC27178@dpotapov.dyndns.org>
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.

Show 8 quoted lines
> 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
Previous: Vlad Didenko
Message 2 of 2 in “Exclude a directory while merging”
  1. Vlad DidenkoJul 30, 2009
  2. Dmitry PotapovJul 30, 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.