{"thread":{"id":"21130","subject":"Re: \"Not currently on any branch\"","startedAt":"2009-10-05T04:01:20Z","lastAt":"2009-10-05T04:19:09Z","messageCount":2,"participants":["Timothy Washington","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124216","messageId":"106990.92203.qm@web111508.mail.gq1.yahoo.com","threadId":"21130","inReplyTo":null,"subject":"Re: \"Not currently on any branch\"","fromName":"Timothy Washington","fromEmail":"timothyjwashington@yahoo.ca","sentAt":"2009-10-05T04:01:20Z","receivedAt":"2009-10-05T04:01:20Z","isPatch":false,"sender":{"key":"timothyjwashington@yahoo.ca","avatar":null},"body":"\nThanks for all the responses so far. But if you take a look at my repo (http://repo.or.cz/w/Bookkeeping.git), at the bottom of the page, there's clearly a 'ui-integration' branch. But if I try to go to my ui-integration branch, I get the message below. So I'm just clueless as to where it went. If use the -b option, then I'll create a new branch. But I don't want that. I want to keep all the data that was in my original 'ui-integration' branch. \n\n[timothyw] ~/Projects/Bookkeeping.4 $ git checkout ui-integration\nerror: pathspec 'ui-integration' did not match any file(s) known to git.\n\n\nThese are what's in the files under my .git/ directory. And again, I'm foggy as to where my ui-integration branch went and to how to get it back. \n\n\"HEAD\"\ncee341c53a249f7d003a12cfeb8cc743275d028f\n\n\"ORIG_HEAD\"\nbaca7c9f43e44d67406d3671e0afd84eaea870a3\n\n\"config\"\n[core]\n    repositoryformatversion = 0\n    filemode = true\n    bare = false\n    logallrefupdates = true\n    ignorecase = true\n[remote \"origin\"]\n    url = http://repo.or.cz/r/Bookkeeping.git\n    fetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n    remote = origin\n    merge = refs/heads/master\n\n\"description\"\nUnnamed repository; edit this file to name it for gitweb.\n\nfig. 1 \n\n\nThanks\nTim \n\n\n\n\n\n\n________________________________\nFrom: Clemens Buchacher <drizzd@aon.at>\nTo: Tim <timothyjwashington@yahoo.ca>\nCc: git@vger.kernel.org\nSent: Sunday, October 4, 2009 3:22:29 AM\nSubject: Re: \"Not currently on any branch\"\n\nOn 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\n________________________________\nInstant message from any web browser! Try the new Yahoo! Canada Messenger for the Web BETA\n\n\n      __________________________________________________________________\nYahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now\nhttp://ca.toolbar.yahoo.com.\n"},{"id":"124217","messageId":"7vd452iibm.fsf@alter.siamese.dyndns.org","threadId":"21130","inReplyTo":"106990.92203.qm@web111508.mail.gq1.yahoo.com","subject":"Re: \"Not currently on any branch\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-05T04:19:09Z","receivedAt":"2009-10-05T04:19:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Timothy Washington <timothyjwashington@yahoo.ca> writes:\n\n> Thanks for all the responses so far. But if you take a look at my repo\n> (http://repo.or.cz/w/Bookkeeping.git), at the bottom of the page,\n> there's clearly a 'ui-integration' branch. But if I try to go to my\n> ui-integration branch, I get the message below. So I'm just clueless as\n> to where it went. If use the -b option, then I'll create a new\n> branch. But I don't want that. I want to keep all the data that was in\n> my original 'ui-integration' branch.\n>\n> [timothyw] ~/Projects/Bookkeeping.4 $ git checkout ui-integration\n> error: pathspec 'ui-integration' did not match any file(s) known to git.\n\nI do not think it has anything to do with \"Not currently on any branch\",\nbut judging from this\n\n> [remote \"origin\"]\n>     url = http://repo.or.cz/r/Bookkeeping.git\n>     fetch = +refs/heads/*:refs/remotes/origin/*\n\none possibility to see the above error message is to do this:\n\n    $ git clone http://repo.or.cz/r/Bookkeeping.git\n    $ cd Bookkeeping\n    $ git checkout ui-integration\n    error: pathspec 'ui-integration' did not match any file(s) known to git.\n\nIn a clone, your local branch namespace is not cluttered with all the\ndifferent branches your upstream repository has.  To wit:\n\n    $ git branch\n    * master\n    $ git branch -a\n    * master\n      remotes/origin/HEAD -> origin/master\n      remotes/origin/master\n      remotes/origin/ui-integration\n\nIf you want to further work on the ui-integration topic, you would do\nsomething like:\n\n    $ git checkout -b ui-integration origin/ui-integration\n    Branch ui-integration set up to track remote branch ui-integration from origin.\n    Switched to a new branch 'ui-integration'\n    $ git branch\n      master\n    * ui-integration\n\nOn the other hand, if you are not interested in working on that topic but\njust want to look at it, e.g. merge it to your master:\n\n    $ git branch\n    * master\n    $ git merge origin/ui-integration\n\nwithout creating a local ui-integration branch at all (iow, skip that\n\"checkout -b\" step above altogether).\n"}]}