{"thread":{"id":"15650","subject":"Applying changes across divergent branches","startedAt":"2008-09-24T14:40:14Z","lastAt":"2008-09-24T17:09:56Z","messageCount":2,"participants":["Tom Schutzer-Weissmann","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91469","messageId":"48DA514E.6060904@siscog.pt","threadId":"15650","inReplyTo":null,"subject":"Applying changes across divergent branches","fromName":"Tom Schutzer-Weissmann","fromEmail":"tom.weissmann@siscog.pt","sentAt":"2008-09-24T14:40:14Z","receivedAt":"2008-09-24T14:40:14Z","isPatch":false,"sender":{"key":"tom.weissmann@siscog.pt","avatar":null},"body":"Hello all,\n\nI am looking into how to apply git to some current working methods.\n\nWe tend to have two or three main branches: the development branch, and \none or two product branches. The development branch is the cutting edge, \nand each product branches off from it.\n\nWhile the product branch shares history with the development branch, not \nall changes to the development branch will get applied to the product \nbranch. We tend to maintain two versions of a product at any time, \nmeaning two divergent product branches.\n\nCould we use git, or a tool based on git, to change on the development \nbranch and selectively apply changes to the other branches - is it as \nsimple as using git cherry-pick?\n\nThanks in advance,\nTom SW\n"},{"id":"91496","messageId":"20080924170956.GA9265@coredump.intra.peff.net","threadId":"15650","inReplyTo":"48DA514E.6060904@siscog.pt","subject":"Re: Applying changes across divergent branches","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-09-24T17:09:56Z","receivedAt":"2008-09-24T17:09:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Sep 24, 2008 at 03:40:14PM +0100, Tom Schutzer-Weissmann wrote:\n\n> Could we use git, or a tool based on git, to change on the development  \n> branch and selectively apply changes to the other branches - is it as  \n> simple as using git cherry-pick?\n\nIf I am understanding your description of the problem correctly, then\nyes, it is as simple as cherry-picking.\n\nIf your branches have a strict hierarchy, you can also use a \"merge up\"\nworkflow where some branches always contain all of other branches. For\nexample, in git has a \"maint\" branch for stable bugfixes and a \"master\"\nbranch for general development. The rule is that one must always merge\n\"up\", meaning that master can merge from maint, but maint can never\nmerge from master. Stable bugfixes go on maint, and then get to master\nby merging.\n\nDepending on the details of your branches, something like that may work\nfor you. You can have a \"base\" branch that all product branches merge\nfrom, and only changes which should affect all products go on that\nbranch (or on topic branches that are based on the \"base\" branch).\n\n-Peff\n"}]}