{"thread":{"id":"35679","subject":"Workflow on git with 2 branch with specifc code","startedAt":"2014-01-17T12:14:28Z","lastAt":"2014-01-18T16:07:33Z","messageCount":4,"participants":["Gordon Freeman","brian m. carlson","Jon Seymour"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"233287","messageId":"1389960868.21737.2.camel@pc14.intranet","threadId":"35679","inReplyTo":null,"subject":"Workflow on git with 2 branch with specifc code","fromName":"Gordon Freeman","fromEmail":"freemanmtc@gmail.com","sentAt":"2014-01-17T12:14:28Z","receivedAt":"2014-01-17T12:14:28Z","isPatch":false,"sender":{"key":"freemanmtc@gmail.com","avatar":null},"body":"Hello guys, im Gordon.\n\nI have a question about workflow with git that i dont know if im doing\nit right.\nI have 1 repo with 2 branchs the first is the master of the project.\nthe second is a branch copy of the master but he need to have some\nspecifc code because is code for a client.\nso, every time that i updade master i need to merge master with client\nbranch and it give me conflicts of course that will hapen.\nWell if was just me who work on this 2 branchs it will be easy to fix\nthe conflicts and let all work and shine.\nBut whe have here, 10 people woking on master branch and some times code\nare lost on merge and we need to look on commits to search whats goin\non. \nWhat i just asking here is if its correct the workflow that i do. If for\nsome problem like this, the community have a standard resolution. Or if\nwhat im doing here is all wrong.\n\nAny help here will be apreciated.\nThx for all.\n\n~                                                                                                                                               \n~                                                                                                                                               \n~                                                                                                                                               \n~                                                                                          \n"},{"id":"233324","messageId":"20140117230507.GD107228@vauxhall.crustytoothpaste.net","threadId":"35679","inReplyTo":"1389960868.21737.2.camel@pc14.intranet","subject":"Re: Workflow on git with 2 branch with specifc code","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-01-17T23:05:07Z","receivedAt":"2014-01-17T23:05:07Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Fri, Jan 17, 2014 at 10:14:28AM -0200, Gordon Freeman wrote:\n> Hello guys, im Gordon.\n>\n> I have a question about workflow with git that i dont know if im doing\n> it right.\n> I have 1 repo with 2 branchs the first is the master of the project.\n> the second is a branch copy of the master but he need to have some\n> specifc code because is code for a client.\n> so, every time that i updade master i need to merge master with client\n> branch and it give me conflicts of course that will hapen.\n> Well if was just me who work on this 2 branchs it will be easy to fix\n> the conflicts and let all work and shine.\n> But whe have here, 10 people woking on master branch and some times code\n> are lost on merge and we need to look on commits to search whats goin\n> on.\n> What i just asking here is if its correct the workflow that i do. If for\n> some problem like this, the community have a standard resolution. Or if\n> what im doing here is all wrong.\n\nThere are many correct workflows.  I personally use the workflow you've\nmentioned for the exact same reason (customizations for a client), but\nI'm the only developer on that repository.\n\nWhat you might try instead is a slightly different workflow.  Have each\ndeveloper create a feature branch to add a feature or fix a bug.  Merge\nthese into master as they become ready.  Have a specific person or group\nof people be integrators, and have them merge master into the client\nbranch as necessary, fixing up any conflicts.  When conflicts are\nnon-trivial, use pair programming or a review process to ensure that the\nresult is good.\n\nWe use a similar workflow at my regular employer, and it is generally\nvery successful for a department with 45 employees.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"233334","messageId":"CAH3Anrq9XbkFj+K7FJ28XAwwYkc1UseDrCdjWCEJ+kJjFsKrUQ@mail.gmail.com","threadId":"35679","inReplyTo":"20140117230507.GD107228@vauxhall.crustytoothpaste.net","subject":"Re: Workflow on git with 2 branch with specifc code","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2014-01-18T03:30:50Z","receivedAt":"2014-01-18T03:30:50Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sat, Jan 18, 2014 at 10:05 AM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> On Fri, Jan 17, 2014 at 10:14:28AM -0200, Gordon Freeman wrote:\n>> Hello guys, im Gordon.\n>>\n>> I have a question about workflow with git that i dont know if im doing\n>> it right.\n>> I have 1 repo with 2 branchs the first is the master of the project.\n>> the second is a branch copy of the master but he need to have some\n>> specifc code because is code for a client.\n>> so, every time that i updade master i need to merge master with client\n>> branch and it give me conflicts of course that will hapen.\n>> Well if was just me who work on this 2 branchs it will be easy to fix\n>> the conflicts and let all work and shine.\n>> But whe have here, 10 people woking on master branch and some times code\n>> are lost on merge and we need to look on commits to search whats goin\n>> on.\n>> What i just asking here is if its correct the workflow that i do. If for\n>> some problem like this, the community have a standard resolution. Or if\n>> what im doing here is all wrong.\n>\n> There are many correct workflows.  I personally use the workflow you've\n> mentioned for the exact same reason (customizations for a client), but\n> I'm the only developer on that repository.\n>\n\nI agree with Brian that there are many correct workflows and which one\nyou choose does depend on details of the branches you are trying to\nmanage.\n\nMyself, I would tend to avoid a workflow in which you continually\nmerge from master into the client branch. The reason is that once you\nhave done this 20 times or so it will become quite difficult to\nunderstand how and why the client branch diverged from the master\nbranch. Yes, it is in the history, but reasoning about diffs that\ncross merge points is just hard.\n\nAssuming that there is not much actual development on the client\nbranch, but rather a relatively small set of customizations to\nconfiguration and things of that kind, then I would tend to maintain\nthe client changes as topic branch, then maintain a client integration\nbranch which represents the merge between master and the client topic\nbranch. Changes that represent divergence of the client from the\nmaster branch would be committed to the client topic branch and then\nmerged into the client integration branch.  Refreshes from master\nwould be merged into the integration branch. Commits directly to the\nintegration branch would be avoided where possible.\n\nOnce master has diverged from client enough that there start to be\nfrequent conflicts when merging into the integration branch, then\nconsider rebasing the client topic branch onto the tip of master\nbranch and then repeat the cycle again. There is some risk of history\nloss with this approach - a later release of the client branch may not\nbe a direct descendent of an earlier release of the client branch, but\neven this problem can be solved with judicious use of merge -s ours\nafter you have successfully rebased the client topic branch. I can\nexpand on how you do this, if there is interest.\n\njon.\n"},{"id":"233338","messageId":"52DAA6C5.8060305@gmail.com","threadId":"35679","inReplyTo":"CAH3Anrq9XbkFj+K7FJ28XAwwYkc1UseDrCdjWCEJ+kJjFsKrUQ@mail.gmail.com","subject":"Re: Workflow on git with 2 branch with specifc code","fromName":"Gordon Freeman","fromEmail":"freemanmtc@gmail.com","sentAt":"2014-01-18T16:07:33Z","receivedAt":"2014-01-18T16:07:33Z","isPatch":false,"sender":{"key":"freemanmtc@gmail.com","avatar":null},"body":"Hello!\nThx you all guys for the help. That's no need more explanations here for \nrebases Jon.\nI alredy do a lot of  this when i need to change configs  of databases \nand domains and other things,\nof my local branch to do some tests, so this is ok for me.\nSeems that i just need some. some people organization here.\nI will get that info that you guys provide to our devel group and aply that.\n\nThaks you all for the help.\n\nOn 18/01/2014 01:30, Jon Seymour wrote:\n> On Sat, Jan 18, 2014 at 10:05 AM, brian m. carlson \n> <sandals@crustytoothpaste.net> wrote:\n>> On Fri, Jan 17, 2014 at 10:14:28AM -0200, Gordon Freeman wrote:\n>>> Hello guys, im Gordon. I have a question about workflow with git \n>>> that i dont know if im doing it right. I have 1 repo with 2 branchs \n>>> the first is the master of the project. the second is a branch copy \n>>> of the master but he need to have some specifc code because is code \n>>> for a client. so, every time that i updade master i need to merge \n>>> master with client branch and it give me conflicts of course that \n>>> will hapen. Well if was just me who work on this 2 branchs it will \n>>> be easy to fix the conflicts and let all work and shine. But whe \n>>> have here, 10 people woking on master branch and some times code are \n>>> lost on merge and we need to look on commits to search whats goin \n>>> on. What i just asking here is if its correct the workflow that i \n>>> do. If for some problem like this, the community have a standard \n>>> resolution. Or if what im doing here is all wrong. \n>> There are many correct workflows. I personally use the workflow \n>> you've mentioned for the exact same reason (customizations for a \n>> client), but I'm the only developer on that repository. \n> I agree with Brian that there are many correct workflows and which one \n> you choose does depend on details of the branches you are trying to \n> manage. Myself, I would tend to avoid a workflow in which you \n> continually merge from master into the client branch. The reason is \n> that once you have done this 20 times or so it will become quite \n> difficult to understand how and why the client branch diverged from \n> the master branch. Yes, it is in the history, but reasoning about \n> diffs that cross merge points is just hard. Assuming that there is not \n> much actual development on the client branch, but rather a relatively \n> small set of customizations to configuration and things of that kind, \n> then I would tend to maintain the client changes as topic branch, then \n> maintain a client integration branch which represents the merge \n> between master and the client topic branch. Changes that represent \n> divergence of the client from the master branch would be committed to \n> the client topic branch and then merged into the client integration \n> branch. Refreshes from master would be merged into the integration \n> branch. Commits directly to the integration branch would be avoided \n> where possible. Once master has diverged from client enough that there \n> start to be frequent conflicts when merging into the integration \n> branch, then consider rebasing the client topic branch onto the tip of \n> master branch and then repeat the cycle again. There is some risk of \n> history loss with this approach - a later release of the client branch \n> may not be a direct descendent of an earlier release of the client \n> branch, but even this problem can be solved with judicious use of \n> merge -s ours after you have successfully rebased the client topic \n> branch. I can expand on how you do this, if there is interest. jon.\n"}]}