How do I fix "remote: fatal error in commit_refs" errors trying to push with Git?

When I try to push to master I get:

remote: fatal error in commit_refs

How can I solve this?


Solution 1:

In my case, GitHub was down by the time I was trying to push.

Just check https://www.githubstatus.com/ to know about GitHub site status.

When it's up you'll be able to push.

Solution 2:

This fixed it for me:

git gc

That will start a garbage collection that resolved my error.