There are LOTs of answers pertaining to this on SO but none of them seem to work for me.
I'm using git ver. 2.25.1.
git remote show origin
shows:
remote origin Fetch URL: /opt/ideatree Push URL: /opt/ideatree
HEAD branch: dotImport
Remote branches:
dotImport tracked
getProdWorking tracked
master tracked Local branch configured for 'git pull':
master merges with remote master Local ref configured for 'git push':
master pushes to master (up to date)
Local is fine. It's the "HEAD branch: dotImport" that I'm trying to alter, to "HEAD branch: master".
Since 'dotImport' is not the main branch eventually I will want to delete it on remote, but that can't happen as long as HEAD is set to dotImport:
git push origin --delete dotImport
remote: error: By default, deleting the current branch is denied, because the next
remote: 'git clone' won't result in any file checked out, causing confusion.
Attempting to re-assign HEAD:
git symbolic-ref HEAD refs/heads/master
has no effect.
git remote set-head origin --auto
yields:
origin/HEAD set to dotImport
It just won't budge.
Here's another view of what it looks like on the remote, which disagrees with what 'git remote show origin' says:
git branch -r
origin/HEAD -> origin/master
origin/dotImport
origin/master
Maybe I'm missing a step which updates the remote with HEAD changes made locally?