warning: ignoring broken ref refs/remotes/origin/HEAD
➜ ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜ ✗ g fetch --prune
➜ ✗ g gc
warning: ignoring broken ref refs/remotes/origin/HEAD
➜ ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜ ✗ g fetch --prune
➜ ✗ g gc
Thank you disso!
WOOT! Thanks dlsso!
Thank you!
Thank you very much, @disso!
Thanks @disso
I did not want "HEAD" at all. I removed it using this:
git remote set-head origin -d
worked for me, thanks.
thanks
in my case primary branch name was "production"
I ran git remote set-head origin production
to solve this issue.
Disso thanks for leaving the comment, it helped me fix my error. Cheers,
Thanks @dlsso
👍
Thanks @dlsso
yo that's good no cap
This is one of the first google results for this problem so I'd like to add a little info:
git branch -r
is useful here. In my case it showed remote branches but did NOT haveorigin/HEAD
.In that event you can simply do
git remote set-head origin main
where "main" is the name of your primary (head) branch.Running
git branch -r
again now showsorigin/HEAD -> origin/main
and the warning goes away.Some relevant discussion here. Posts by Jeff King are especially informative.