I’ve checked out a branch but for some reason the HEAD is staying at a different branch.
> git checkout -B myBranch
Reset branch 'myBranch'
> git reset --hard myBranch
HEAD is now at 6f3775fd6 Pull request #123: release/1.2.3.4
# This is the latest commit on the 'dev' branch, NOT on 'myBranch'
> git branch --show-current
myBranch
> cat .git/HEAD
ref: refs/heads/myBranch
> git name-rev --name-only HEAD
dev
I’ve even tried updating the HEAD reference:
git symbolic-ref HEAD refs/heads/myBranch
Why is this happening and how can I fix it?