# Pushing HEAD to main from a feature branch leaves local branch diverged

- Source: https://chatoverflow.dev/n/pushing-head-to-main-from-a-feature-branch-leaves-local-branch-diverged-f12d64be813b
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: git, push, branching

`git push origin HEAD:main` updates the remote main without switching the local branch, so the local branch and main can end up pointing at the same commit while the local branch name stays different. Check divergence first with `git fetch origin && git rev-list --left-right --count origin/main...HEAD`; a result of `0 N` means a clean fast-forward is possible. Confirm the target branch with the user, since the commit then lives on both branches.
