{"thread":{"id":"21116","subject":"\"Not currently on any branch\"","startedAt":"2009-10-02T20:08:52Z","lastAt":"2009-10-04T07:22:29Z","messageCount":5,"participants":["Tim","Steven Noonan","Alex Riesen","Sean Estabrooks","Clemens Buchacher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124147","messageId":"loom.20091002T215942-663@post.gmane.org","threadId":"21116","inReplyTo":null,"subject":"\"Not currently on any branch\"","fromName":"Tim","fromEmail":"timothyjwashington@yahoo.ca","sentAt":"2009-10-02T20:08:52Z","receivedAt":"2009-10-02T20:08:52Z","isPatch":false,"sender":{"key":"timothyjwashington@yahoo.ca","avatar":null},"body":"I have some code in a git repo that is \"Not currently on any branch\". Now,\nthere's the master branch and another branch 'ui-integration' that I'm using in\nthis project. I don't know how the project got into this headless state, but I\nneed to be using the 'ui-integration' branch. \n\nI tried looking around the blogosphere for a solution, and tried what I found\nhere. But it seems like only my last commit (not the previous 10 I made) shows\nup in the master branch (not ui-integration ).  \nhttp://blog.kortina.net/post/71935540/fix-git-not-currently-on-any-branch-problem\n\nWhat's the most straightforward & cleanest way to merge my changes in the\nheadless branch to my 'ui-integration' branch? \n\nThanks in advance\nTim\n"},{"id":"124148","messageId":"f488382f0910021358nc4a8c2ehca665c47aa39224c@mail.gmail.com","threadId":"21116","inReplyTo":"loom.20091002T215942-663@post.gmane.org","subject":"Re: \"Not currently on any branch\"","fromName":"Steven Noonan","fromEmail":"steven@uplinklabs.net","sentAt":"2009-10-02T20:58:42Z","receivedAt":"2009-10-02T20:58:42Z","isPatch":false,"sender":{"key":"steven@uplinklabs.net","avatar":"https://gravatar.com/avatar/b0cd397a10638433f76e084531aa0af3bef85f8fdb59b1ebe2ddaf168cd100e9?d=mp&s=160"},"body":"On Fri, Oct 2, 2009 at 1:08 PM, Tim <timothyjwashington@yahoo.ca> wrote:\n> I have some code in a git repo that is \"Not currently on any branch\". Now,\n> there's the master branch and another branch 'ui-integration' that I'm using in\n> this project. I don't know how the project got into this headless state, but I\n> need to be using the 'ui-integration' branch.\n>\n> I tried looking around the blogosphere for a solution, and tried what I found\n> here. But it seems like only my last commit (not the previous 10 I made) shows\n> up in the master branch (not ui-integration ).\n> http://blog.kortina.net/post/71935540/fix-git-not-currently-on-any-branch-problem\n>\n> What's the most straightforward & cleanest way to merge my changes in the\n> headless branch to my 'ui-integration' branch?\n>\n\nTry 'git checkout -b temp', which creates a branch called 'temp' with\nits HEAD at where you currently are, and then merge your changes to\nui-integration via 'git checkout ui-integration; git merge temp', and\nfinally drop the junk branch with 'git branch -d temp'\n\n- Steven\n"},{"id":"124150","messageId":"81b0412b0910021446nb07e7e9l465f588168297fe9@mail.gmail.com","threadId":"21116","inReplyTo":"loom.20091002T215942-663@post.gmane.org","subject":"Re: \"Not currently on any branch\"","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-10-02T21:46:53Z","receivedAt":"2009-10-02T21:46:53Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Fri, Oct 2, 2009 at 22:08, Tim <timothyjwashington@yahoo.ca> wrote:\n> What's the most straightforward & cleanest way to merge my changes in the\n> headless branch to my 'ui-integration' branch?\n\nAssuming you use a Bourne shell:\n\n$ prev=$(git rev-parse HEAD)\n$ git checkout ui-integration && git merge $prev\n"},{"id":"124158","messageId":"BLU0-SMTP927FF0174DF8AAD58644A8AED20@phx.gbl","threadId":"21116","inReplyTo":"81b0412b0910021446nb07e7e9l465f588168297fe9@mail.gmail.com","subject":"Re: \"Not currently on any branch\"","fromName":"Sean Estabrooks","fromEmail":"seanlkml@sympatico.ca","sentAt":"2009-10-02T23:15:37Z","receivedAt":"2009-10-02T23:15:37Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Fri, 2 Oct 2009 23:46:53 +0200\nAlex Riesen <raa.lkml@gmail.com> wrote:\n\n> On Fri, Oct 2, 2009 at 22:08, Tim <timothyjwashington@yahoo.ca> wrote:\n> > What's the most straightforward & cleanest way to merge my changes in the\n> > headless branch to my 'ui-integration' branch?\n> \n> Assuming you use a Bourne shell:\n> \n> $ prev=$(git rev-parse HEAD)\n> $ git checkout ui-integration && git merge $prev\n> \n> \n\nYou could also rely on the reflog to avoid the need to store off the\nprevious HEAD value, so just:\n\n$ git checkout ui-integration && git merge HEAD@{1}\n\n\nSean\n"},{"id":"299122","messageId":"20091004072229.GA14142@localhost","threadId":"21116","inReplyTo":"loom.20091002T215942-663@post.gmane.org","subject":"Re: \"Not currently on any branch\"","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-10-04T07:22:29Z","receivedAt":"2009-10-04T07:22:29Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Fri, Oct 02, 2009 at 08:08:52PM +0000, Tim wrote:\n> I have some code in a git repo that is \"Not currently on any branch\". Now,\n> there's the master branch and another branch 'ui-integration' that I'm\n> using in this project. I don't know how the project got into this headless\n> state, but I need to be using the 'ui-integration' branch. \n\nIt can happen either by explicitly detaching HEAD using \"git checkout\n<commit>\", or if you used rebase and it is still in progress.\n\nClemens\n"}]}