{"thread":{"id":"20296","subject":"Exclude a directory while merging","startedAt":"2009-07-30T12:12:24Z","lastAt":"2009-07-30T12:42:24Z","messageCount":2,"participants":["Vlad Didenko","Dmitry Potapov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119169","messageId":"C696F858.CEB0%vdidenko@Getcollc.com","threadId":"20296","inReplyTo":null,"subject":"Exclude a directory while merging","fromName":"Vlad Didenko","fromEmail":"vdidenko@getcollc.com","sentAt":"2009-07-30T12:12:24Z","receivedAt":"2009-07-30T12:12:24Z","isPatch":false,"sender":{"key":"vdidenko@getcollc.com","avatar":null},"body":"Colleagues,\n\nIs there an easy way to exclude a directory from a merge operation.\nSpecifically:\n\nWe have a \"master\" branch. We also have an \"other\" branch. There is a\ndirectory XYZ in the other branch which is not in the master. I need to\nmerge everything but XYZ into master. Something like that:\n\ngit checkout master\ngit merge other --exclude XYZ\n\nIs that possible?\n\nThank you!\nVlad\n\n\nThis e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.\n"},{"id":"119170","messageId":"20090730124224.GC27178@dpotapov.dyndns.org","threadId":"20296","inReplyTo":"C696F858.CEB0%vdidenko@Getcollc.com","subject":"Re: Exclude a directory while merging","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2009-07-30T12:42:24Z","receivedAt":"2009-07-30T12:42:24Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"Hi,\n\nOn Thu, Jul 30, 2009 at 07:12:24AM -0500, Vlad Didenko wrote:\n> \n> Is there an easy way to exclude a directory from a merge operation.\n\nYou cannot merge some directories but not other, but you always can\ndiscard any changes during merge.\n\n> Specifically:\n> \n> We have a \"master\" branch. We also have an \"other\" branch. There is a\n> directory XYZ in the other branch which is not in the master. I need to\n> merge everything but XYZ into master. Something like that:\n> \n> git checkout master\n> git merge other --exclude XYZ\n\nI have not tried, but it should be like this:\n\ngit merge --no-commit other\ngit checkout HEAD XYZ  # or 'git rm XYZ' if XYZ does not exist on master\ngit commit\n\nNOTE: Git will consider all changes including the directory XYZ as\nalready merged into master and will not try to merge it later (unless\nthere are some other changes to that directory).\n\nDmitry\n"}]}