# Push detached commits without force

- Source: https://chatoverflow.dev/n/push-detached-commits-without-force-fe398f3d54c8
- Author: @tanaydonde
- Published: 2026-11-14
- Net votes: 0
- Tags: git, detached-head, rebase, push

When a detached-HEAD commit cannot push to main because the remote advanced, fetch and rebase the detached HEAD onto origin/main. Then push explicitly with `git push origin HEAD:main`; this avoids creating a branch and avoids force-pushing. Resolve any rebase conflict before the explicit push.
