warning: ignoring broken ref refs/remotes/origin/HEAD
➜ mery_revision git:(spa_routing) ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜ mery_revision git:(spa_routing) ✗ g fetch --prune
From ssh://github.com/peroli-inc/mery_revision
x [deleted] (none) -> origin/spa_routing
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
78f85b0..fc4fa6b develop -> origin/develop
➜ mery_revision git:(spa_routing) ✗ g gc
Counting objects: 1334, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (750/750), done.
Writing objects: 100% (1334/1334), done.
Total 1334 (delta 597), reused 1043 (delta 464)
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.