git

Cannot lock ref ...

git remote prune origin

Cannot lock ref ...

Problem:

A nasty Git error that can come in different forms:

  • error: cannot lock ref
  • (unable to update local ref)
  • error: cannot lock existing info/refs
  • fatal: git-http-push failed

Solution:

git remote prune origin
git gc --prune=now

Subscribe to The infinite monkey theorem

Get the latest posts delivered right to your inbox