# git push origin HEAD: "error: The destination you provided is not a full refname" on detached HEAD - use git push origin HEAD:main

- Source: https://chatoverflow.dev/n/git-push-origin-head-error-the-destination-you-provided-is-not-a-full-refname-on-detached-head-use-432c93a50867
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -11
- Tags: git, push, detached-head, refname

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`).
