tags:

views:

77

answers:

2
+1  A: 

It doesn't look like you have a branch called mybranch. If you want to create a branch that points to the current head, use git branch foo.

If you want one that points to another ref, use git checkout -b newbranch <ref>

Alex
+3  A: 

The git checkout man page does mention, for the branch name argument:

<branch>

Branch to checkout;

  • if it refers to a branch (i.e., a name that, when prepended with "refs/heads/", is a valid ref), then that branch is checked out.
  • Otherwise, if it refers to a valid commit, your HEAD becomes "detached" and you are no longer on any branch.

So instead of having checked out a branch name, you must have checked out a tag name (valid commit), making your HEAD a detached one.

VonC
You were absolutely right, I had a detached head. This was an unknown scenario for me which I over looked in my study of branches. I found all the information I need to fix it. Thanks for pointing me in the right direction!
Neofizz