{"thread":{"id":"21336","subject":"[git question] how to handle few projects with common parts?","startedAt":"2009-10-23T09:01:22Z","lastAt":"2009-10-23T16:07:38Z","messageCount":2,"participants":["Ivan Dimitrov","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125783","messageId":"368bc75e0910230201y8e4310dme6276d436c6a6ab6@mail.gmail.com","threadId":"21336","inReplyTo":null,"subject":"[git question] how to handle few projects with common parts?","fromName":"Ivan Dimitrov","fromEmail":"ivand58@gmail.com","sentAt":"2009-10-23T09:01:22Z","receivedAt":"2009-10-23T09:01:22Z","isPatch":false,"sender":{"key":"ivand58@gmail.com","avatar":null},"body":"Hi list,\nMaybe my question relates rather to configuration management, but it\nis over GIT.\nIn short - I have to manage two projects with 95% same files\n(components) and all the rest are platform depended. I am trying to\nkeep different platforms in different branches, but I can't figure out\nhow keep the common part of the project synchronized?\n\n-- \nBest Regards,\nIvan Dimitrov\n"},{"id":"125791","messageId":"32541b130910230907x38d8c1f8vb504865eaf5b524@mail.gmail.com","threadId":"21336","inReplyTo":"368bc75e0910230201y8e4310dme6276d436c6a6ab6@mail.gmail.com","subject":"Re: [git question] how to handle few projects with common parts?","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-23T16:07:38Z","receivedAt":"2009-10-23T16:07:38Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Fri, Oct 23, 2009 at 5:01 AM, Ivan Dimitrov <ivand58@gmail.com> wrote:\n> Maybe my question relates rather to configuration management, but it\n> is over GIT.\n> In short - I have to manage two projects with 95% same files\n> (components) and all the rest are platform depended. I am trying to\n> keep different platforms in different branches, but I can't figure out\n> how keep the common part of the project synchronized?\n\nAre the other files (1) *completely* different across branches, or (2)\nthe same in each branch, but customized?\n\nIf (1), I don't think branches are the answer.  You probably just want\na subdir per platform and a simple config file that points at which\nbranch to use.  Or maybe use some #ifdefs, or whatever the equivalent\nis in your system.\n\nIf (2), perhaps what you want is three branches: a main development\nbranch, and two customized branches that you merge (or rebase) master\ninto.  I do this sometimes when I want a \"development\" branch and then\nsome specific customizations for a particular production deployment.\n(eg. a default config file and the \"live\" config file, and I want both\nto be version controlled separately)\n\nHave fun,\n\nAvery\n"}]}