{"thread":{"id":"27435","subject":"git branch","startedAt":"2011-05-23T11:36:09Z","lastAt":"2011-05-23T12:36:28Z","messageCount":4,"participants":["Gergely Buday","Marcus Karlsson","Tim Mazid"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"168493","messageId":"BANLkTinzped82Njnw4ZUeHY6Qu4R4hKK-w@mail.gmail.com","threadId":"27435","inReplyTo":null,"subject":"git branch","fromName":"Gergely Buday","fromEmail":"gbuday@gmail.com","sentAt":"2011-05-23T11:36:09Z","receivedAt":"2011-05-23T11:36:09Z","isPatch":false,"sender":{"key":"gbuday@gmail.com","avatar":null},"body":"Hi there,\n\nI created\n\ngit branch install_2.0\n\nfor my install script. Then pushed to\n\ngit push origin install_2.0\n\nso that github stores by branch\n\nafter another commit I tried to push again but git told me that I'm\nnot on that branch. Why git loses the state that I'm on a branch? What\nshould I do to have my expected behaviour?\n\n- Gergely\n"},{"id":"168494","messageId":"20110523114633.GE7387@kennedy.acc.umu.se","threadId":"27435","inReplyTo":"BANLkTinzped82Njnw4ZUeHY6Qu4R4hKK-w@mail.gmail.com","subject":"Re: git branch","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2011-05-23T11:46:33Z","receivedAt":"2011-05-23T11:46:33Z","isPatch":false,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"On Mon, May 23, 2011 at 01:36:09PM +0200, Gergely Buday wrote:\n> Hi there,\n> \n> I created\n> \n> git branch install_2.0\n> \n> for my install script. Then pushed to\n> \n> git push origin install_2.0\n> \n> so that github stores by branch\n> \n> after another commit I tried to push again but git told me that I'm\n> not on that branch. Why git loses the state that I'm on a branch? What\n> should I do to have my expected behaviour?\n> \n> - Gergely\n\nI'm not sure if I'm following you correctly, but with Git you need to\ncheck out your branch after creating it. Run git checkout install_2.0\nafter you have created it.\n\n\tMarcus\n"},{"id":"168496","messageId":"BANLkTim_L0M2oFV383+5n7-X_KQTdd3BAg@mail.gmail.com","threadId":"27435","inReplyTo":"20110523114633.GE7387@kennedy.acc.umu.se","subject":"Re: git branch","fromName":"Gergely Buday","fromEmail":"gbuday@gmail.com","sentAt":"2011-05-23T12:17:38Z","receivedAt":"2011-05-23T12:17:38Z","isPatch":false,"sender":{"key":"gbuday@gmail.com","avatar":null},"body":"> I'm not sure if I'm following you correctly, but with Git you need to\n> check out your branch after creating it. Run git checkout install_2.0\n> after you have created it.\n\nYes, that sounds reasonable. I did not know it was necessary to \"switch to it\".\n\n- Gergely\n"},{"id":"168497","messageId":"SNT124-W21FCFAE653C2B81DD980BFC4720@phx.gbl","threadId":"27435","inReplyTo":"BANLkTim_L0M2oFV383+5n7-X_KQTdd3BAg@mail.gmail.com","subject":"RE: git branch","fromName":"Tim Mazid","fromEmail":"timmazid@hotmail.com","sentAt":"2011-05-23T12:36:28Z","receivedAt":"2011-05-23T12:36:28Z","isPatch":false,"sender":{"key":"timmazid@hotmail.com","avatar":null},"body":"\n> From: gbuday@gmail.com\n>\n> > I'm not sure if I'm following you correctly, but with Git you need to\n> > check out your branch after creating it. Run git checkout install_2.0\n> > after you have created it.\n>\n> Yes, that sounds reasonable. I did not know it was necessary to \"switch to it\".\n>\n> - Gergely\n\n\nHi Gergely,\n\nThe way that git branches work is that they \"point\" at commits.\nWhen you do a \"git commit\", git updates the branch to point at\nthe new commit you just created. In this way, you can have a\nmultitude of branches and be working on only one at a time.\n\nN.B. If you want to create a branch and \"switch\" (checkout) to\nit at once, you can pass the \"-b\" option to checkout, thus:\n\"git checkout -b new-branch-name\"; this will create a new branch\nnamed \"new-branch-name\" and immediately switch to it.\n\n\nTim.\n\n() ascii ribbon campaign - against html e-mail\n/\\ www.asciiribbon.org - against proprietary attachments\n \t\t \t   \t\t  "}]}