{"thread":{"id":"13397","subject":"Noob question on using branches","startedAt":"2008-05-06T15:47:48Z","lastAt":"2008-05-06T16:15:35Z","messageCount":3,"participants":["Barry Roberts","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76204","messageId":"48207DA4.80502@robertsr.us","threadId":"13397","inReplyTo":null,"subject":"Noob question on using branches","fromName":"Barry Roberts","fromEmail":"blr@robertsr.us","sentAt":"2008-05-06T15:47:48Z","receivedAt":"2008-05-06T15:47:48Z","isPatch":false,"sender":{"key":"blr@robertsr.us","avatar":null},"body":"I have a branch in my git repository that is a \"released\" branch.  It \nonly gets defect fixes as they are needed to patch our production servers.\n\nI want to get all those defect fixes back into the master, but I don't \nwant changes from the master getting into the production branch, so I \ndon't think I want to do:\ngit checkout master\ngit merge production\n\nright?\n\nIt looks like \"git pull --squash . production\" will do what I want.  Is \nthat correct, or is there a better way?  git cherry-pick seems \ncumbersome when I already know I want everything in the branch (unless \nthere's a way to tell cherry-pick to get the whole branch and I've \nmissed that).\n\nThanks,\nBarry Roberts\n"},{"id":"76206","messageId":"vpqiqxrctio.fsf@bauges.imag.fr","threadId":"13397","inReplyTo":"48207DA4.80502@robertsr.us","subject":"Re: Noob question on using branches","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-05-06T16:00:15Z","receivedAt":"2008-05-06T16:00:15Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Barry Roberts <blr@robertsr.us> writes:\n\n> I have a branch in my git repository that is a \"released\" branch.  It\n> only gets defect fixes as they are needed to patch our production\n> servers.\n>\n> I want to get all those defect fixes back into the master, but I don't\n> want changes from the master getting into the production branch, so I\n> don't think I want to do:\n> git checkout master\n> git merge production\n\nWhy wouldn't you?\n\nThe \"git merge production\" will take all the changes in production and\nput them in the current branch. You'll get a new revision that\ncontains both the stuff in master and the one in production. But\nwhat's important is that the reference \"master\" is updated to that new\nrevision, but \"production\" stays where it is.\n\nJust try it, then run \"gitk --all\" to see if the result is what you\nwanted. If not, \"git reset --hard HEAD^\" will move back \"master\" to\nwhere it used to be (read about \"git reset\" before you run it).\n\n-- \nMatthieu\n"},{"id":"76208","messageId":"48208427.5080800@robertsr.us","threadId":"13397","inReplyTo":"vpqiqxrctio.fsf@bauges.imag.fr","subject":"Re: Noob question on using branches","fromName":"Barry Roberts","fromEmail":"blr@robertsr.us","sentAt":"2008-05-06T16:15:35Z","receivedAt":"2008-05-06T16:15:35Z","isPatch":false,"sender":{"key":"blr@robertsr.us","avatar":null},"body":"Matthieu Moy wrote:\n> Barry Roberts <blr@robertsr.us> writes:\n>\n>   \n>> I have a branch in my git repository that is a \"released\" branch.  It\n>> only gets defect fixes as they are needed to patch our production\n>> servers.\n>>\n>> I want to get all those defect fixes back into the master, but I don't\n>> want changes from the master getting into the production branch, so I\n>> don't think I want to do:\n>> git checkout master\n>> git merge production\n>>     \n>\n> Why wouldn't you?\n>\n> The \"git merge production\" will take all the changes in production and\n> put them in the current branch. You'll get a new revision that\n> contains both the stuff in master and the one in production. But\n> what's important is that the reference \"master\" is updated to that new\n> revision, but \"production\" stays where it is.\n>   \nSo it does.  That does appear to be exactly what I need.\n> Just try it, then run \"gitk --all\" to see if the result is what you\n> wanted. If not, \"git reset --hard HEAD^\" will move back \"master\" to\n> where it used to be (read about \"git reset\" before you run it).\n>\n>   \n"}]}