git remote prune origin

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

Welcome to The infinite monkey theorem

Somewhere a monkey just typed Shakespeare in TypeScript. Be the first to read the masterpieces (and the hilarious misfires) landing on the blog.

Subscribe to The infinite monkey theorem

We fling fresh posts—no banana peels attached—straight to your inbox.