You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stray main tag makes git pull origin main a silent no-op (tag shadows branch) #213
refs/tags/main (lightweight, → 0b3b528, #44) coexists with refs/heads/main. Git resolves an unqualified refspec by matching refs/tags/<name> before refs/heads/<name> (count_refspec_match() in remote.c), so the very common
git pull origin main
fetches the tag instead of the branch, then merges/rebases onto the tag's old commit. The command still exits 0, so the failure is silent: the checkout never updates.
Reproduction (against 0be7a76)
$ git fetch --dry-run origin main
* tag main -> FETCH_HEAD # expected: branch
$ git pull --rebase origin main
* tag main -> FETCH_HEAD
Already up to date. # exit 0, branch unchanged
Every client that passes the short branch name to git pull — GUI clients such as UGit do exactly git pull --recurse-submodules origin main, and so do many scripts — silently stops receiving updates. Worse, with pull.rebase=true the local branch can be moved backwards to 0b3b528: rebasing onto an ancestor of HEAD is reported as "already up to date", so the commits above it are dropped from the branch.
We hit precisely this: local main was rewound one commit, and three consecutive pull attempts returned success without applying the ~105 upstream commits. git fetch without a refspec was equally stale, because the branch half of the pull never ran.
git pull with no arguments is unaffected (it resolves branch.<name>.merge rather than matching a remote ref by name), which makes the problem easy to misdiagnose.
Suggested fix
Delete the stray tag — every other tag in this repository follows v*, so main looks accidental:
git push origin :refs/tags/main
(or Releases → Tags → main → Delete in the GitHub UI).
Activity
ci: fail fast when the Windows pipeline would publish a non-release t…