This is the right behavior since you have checked out the remote branch.
If you wish to check out master and work on it you should do this now:
# checkout remote branch as local branch
# this will look up the branch name locally and if it does not find it it
#will checkout your remote branch with this name.
git checkout master
When you checkout remote branch you are simply pointing your HEAD to the latest commit from this branch. If you wish to work on it you have to check it out as local branch without the remote/<branch>
. This will automatically checkout and create local branch with the given name.
If you wish to learn more about the HEAD read all about it here.
What is a detached HEAD?
A detached HEAD mean that your HEAD point to a commit which is not the latest in the commit chain.
In this sample commit #4 is the latest while the HEAD is pointing to commit #2.
temp branch
code to all branchs and it works fine using pushHEAD:master
andHEAD:dev
, now i need to work on origin/dev branch, when running branch -a (i have the remotes/origin/dev, remotes/origin/master, remotes/heroku/master) , but can't chckout the origin master branch, even after doing git fetch origin. – Trillby