I just discovered a HEAD branch in tracking branches.
origin/HEAD
and I cannot check it out.
How to fix?
git checkout HEAD~3(this will detach the HEAD from any certain branch and give you the commit ID as the branch reference - from there you can create a branch referring to this given commit to keep any edits made)
git commit -m "C1"
git commit -m "C2"
git commit -m "C3"
git commit -m "C4"
git checkout HEAD~2
git branch newBranch
What I asked is, how to fix this remote HEAD branch.
But thanks your post, it is still useful anyways.
I sometimes want to push a branch that had just been re-based to origin. It askd me to pull. Then I merged. It created a dummy merge commit... Then I could upload it.
Anyway how to delete that annoying HEAD branch?
You can't delete it because it is not a branch, it signifies your location on the current branch.
I said, it becomes a remote tracking branch. Which is unexpected. I do not want it to be a remote tracking branch.