Fixing a git repo

Updated . Posted . Visible to the public.

If git complains with this error:

fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack

This may happen if upstream branches have been removed and your origin is pointing to it. You can confirm this by running:

cat .git/refs/remotes/origin/HEAD

If it is pointing to a branch that doesn't exist,

Running git remote set-head origin --auto
followed by git gc
will fix it

Chris
Last edit
Chris
Posted by Chris to Chris's deck (2018-07-25 14:11)