Coding⏱️ 2 min read📅 2026-05-30

How to Fix: Git and nasty "error: cannot lock existing info/refs fatal"

Git error: cannot lock existing info/refs fatal. Disable SSL verification and try again.

Quick Answer: Try disabling SSL verification with `git config --global http.sslVerify false` and then push to the remote repository.

The 'error: cannot lock existing info/refs fatal' error occurs when you try to push changes to a remote repository that is already locked by another process or user. This can happen even if the repository appears to be empty or has no pending commits.

🛑 Root Causes of the Error

  • Git is not properly initialized or configured.
  • The remote repository is locked by another user or process.
  • There are conflicts between the local and remote repositories.

✅ Best Solutions to Fix It

Method 1: Force Push

  1. Step 1: Use the `--force` option with `git push origin master --force

Method 2: Remove Local Changes

  1. Step 1: Run `git reset --hard origin/master` to discard local changes and rebase the branch.

🎯 Final Words

To avoid this issue in the future, ensure that your local repository is properly initialized and configured, and use `git push --force` or `git reset --hard origin/master` to resolve conflicts. Always verify the remote repository's lock status before pushing changes.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions