Issue
I did a checkout on the repo for my production site because I wanted to check a change. Now I pointed back my repo to the latest commit but now is not pointing to HEAD branch so instead of this
[gcardonav@gambit workshop]$ git status
# On branch master
I am getting this
[root@prod website]# git status
# Not currently on any branch.
I tried git reset --hard origin/HEAD
but is still not pointing to branch master. What do I need to do?
Solution
The HEAD
pointer is detached, e.g. HEAD
points at a commit that is not pointed by any of your branches. To get back to master
you can run:
git checkout master
Now HEAD
points at the commit that is pointed by master
. Read this for more information
Answered By - neshkeev Answer Checked By - David Marino (WPSolving Volunteer)