Skip to content

Instantly share code, notes, and snippets.

@wdhowe
Last active November 19, 2021 02:31
Show Gist options
  • Save wdhowe/1df8a74e1cc99c89bb93ae37bee165bc to your computer and use it in GitHub Desktop.
Save wdhowe/1df8a74e1cc99c89bb93ae37bee165bc to your computer and use it in GitHub Desktop.
Fix git broken ref refs/remotes/origin/HEAD

Error seen during git commands

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

The Fix

Check remote branches

git branch -r

If the above does not display an "origin/HEAD", the HEAD can be set.

git remote set-head origin main

Where "main" is the primary/head branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment