broken ref Git Origin: Build & delivery Last updated 12 Oct 2026

warning: ignoring broken ref refs/remotes/origin/HEAD

A ref file is empty or points to a missing object — usually refs/remotes/origin/HEAD after the default branch changed.

Exact message you may see ignoring broken ref
Seen on: Git

Meaning

Harmless but noisy. Re-point origin/HEAD to the current default branch.

Common causes

  • Remote default branch renamed (master → main)
  • Corrupted/empty ref file

⚡ Quick fix

  1. git remote set-head origin --auto
  2. Delete the broken ref file if needed

Detailed fix by platform

Git

  1. git remote set-head origin --auto

How to diagnose

  1. Ref — Which ref is broken?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

cannot lock ref — error: cannot lock ref 'refs/remotes/origin/x': is at … but expected … / unable to update local ref (Git)cannot lock refcouldn't find remote ref — fatal: couldn't find remote ref main (Git)couldn't find remote …non-bare push — ! [remote rejected] main -> main (branch is currently checked out) (Git)non-bare pushorigin not a repository — fatal: 'origin' does not appear to be a git repository (Git)origin not a reposito…refs on function components — Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? (React)refs on function comp…remote origin exists — error: remote origin already exists. (Git)remote origin existsRepository not found — remote: Repository not found. fatal: repository 'https://github.com/x/y.git/' not found (Git)Repository not foundbroken ref

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.