{"thread":{"id":"29567","subject":"Merging only a subdirectory from one branch to the other","startedAt":"2012-02-07T09:38:22Z","lastAt":"2012-02-10T00:51:45Z","messageCount":3,"participants":["Howard Miller","Taylor Hedberg","Neal Kreitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"184113","messageId":"CAHVO_90MQamw7oB8ry5YBEWSnRnxDZvQ4ApVuuv4AYR6VRuXSw@mail.gmail.com","threadId":"29567","inReplyTo":null,"subject":"Merging only a subdirectory from one branch to the other","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2012-02-07T09:38:22Z","receivedAt":"2012-02-07T09:38:22Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":"Hi,\n\nI've been Googling for this one and am, mostly, more confused than\nwhen I started so if you could humor me for a moment.\n\nI have a branch with a particular subdirectory tree. The tree has a\nlot of history. However, all the history for that subdirectory is\nexclusive to it (no commits changed anything outside it). I now need\nto merge that subdirectory into a completely different branch without\nloosing any history. I think git-read-tree might have something to do\nwith it but I don't understand the help file at all. Any help\nappreciated.\n\nCheers....\n"},{"id":"184134","messageId":"20120207152457.GB2662@foodlogiq3-xp-d620","threadId":"29567","inReplyTo":"CAHVO_90MQamw7oB8ry5YBEWSnRnxDZvQ4ApVuuv4AYR6VRuXSw@mail.gmail.com","subject":"Re: Merging only a subdirectory from one branch to the other","fromName":"Taylor Hedberg","fromEmail":"tmhedberg@gmail.com","sentAt":"2012-02-07T15:24:57Z","receivedAt":"2012-02-07T15:24:57Z","isPatch":false,"sender":{"key":"tmhedberg@gmail.com","avatar":"https://gravatar.com/avatar/d046da5ea94a7957169aef0fe122771a1f8d9387d39bc68fcfb1332978e11a6c?d=mp&s=160"},"body":"Howard Miller, Tue 2012-02-07 @ 09:38:22+0000:\n> I have a branch with a particular subdirectory tree. The tree has a\n> lot of history. However, all the history for that subdirectory is\n> exclusive to it (no commits changed anything outside it). I now need\n> to merge that subdirectory into a completely different branch without\n> loosing any history. I think git-read-tree might have something to do\n> with it but I don't understand the help file at all. Any help\n> appreciated.\n\nYou might find git-subtree [1] useful for this. The `git subtree split`\nsub-command in particular enables you to factor out the history of a\nparticular subdirectory in your repo into a separate branch, which you\ncould then merge into some other branch as desired.\n\n\n[1] https://github.com/apenwarr/git-subtree\n"},{"id":"184301","messageId":"4F346A21.2080008@gmail.com","threadId":"29567","inReplyTo":"CAHVO_90MQamw7oB8ry5YBEWSnRnxDZvQ4ApVuuv4AYR6VRuXSw@mail.gmail.com","subject":"Re: Merging only a subdirectory from one branch to the other","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-02-10T00:51:45Z","receivedAt":"2012-02-10T00:51:45Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 2/7/2012 3:38 AM, Howard Miller wrote:\n\n> I have a branch with a particular subdirectory tree. The tree has a\n> lot of history. However, all the history for that subdirectory is\n> exclusive to it (no commits changed anything outside it). I now need\n> to merge that subdirectory into a completely different branch without\n> loosing any history. I think git-read-tree might have something to do\n> with it but I don't understand the help file at all. Any help\n> appreciated.\n>\nDoes the 'subtree merge' described in this link do what you want: \nhttp://progit.org/book/ch6-7.html\n(I can't say I've actually tried it myself, yet.)\n\nv/r,\nneal\n"}]}