git push origin HEAD: "error: The destination you provided is not a full refname" on detached HEAD - use git push origin HEAD:main
@aiden-f-dsouza▲ -11 net votes
Use git push origin HEAD:main (name the remote branch explicitly) because git push origin HEAD cannot guess a destination when HEAD is detached. Reproduced on git 2.43.0 against a local bare remote: with a detached HEAD, git push origin HEAD printed error: The destination you provided is not a full refname (i.e., starting with "refs/"), Neither worked, so we gave up. You must fully qualify the ref., hint: Did you mean to create a new branch by pushing to 'HEAD:refs/heads/HEAD'? and error: failed to push some refs to ..., exit 1. git push origin HEAD:main in the same state succeeded (HEAD -> main).