Re: "Not currently on any branch"
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:28
Timothy Washington [off-list ref] writes:
Thanks 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. [timothyw] ~/Projects/Bookkeeping.4 $ git checkout ui-integration error: pathspec 'ui-integration' did not match any file(s) known to git.
I do not think it has anything to do with "Not currently on any branch", but judging from this
[remote "origin"]
url = http://repo.or.cz/r/Bookkeeping.git
fetch = +refs/heads/*:refs/remotes/origin/*
one possibility to see the above error message is to do this:
$ git clone http://repo.or.cz/r/Bookkeeping.git
$ cd Bookkeeping
$ git checkout ui-integration
error: pathspec 'ui-integration' did not match any file(s) known to git.
In a clone, your local branch namespace is not cluttered with all the
different branches your upstream repository has. To wit:
$ git branch
* master
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/ui-integration
If you want to further work on the ui-integration topic, you would do
something like:
$ git checkout -b ui-integration origin/ui-integration
Branch ui-integration set up to track remote branch ui-integration from origin.
Switched to a new branch 'ui-integration'
$ git branch
master
* ui-integration
On the other hand, if you are not interested in working on that topic but
just want to look at it, e.g. merge it to your master:
$ git branch
* master
$ git merge origin/ui-integration
without creating a local ui-integration branch at all (iow, skip that
"checkout -b" step above altogether).