SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Git New Added 8 September 2026

git: SSL certificate problem: unable to get local issuer certificate

Git could not build a trust chain to the server's certificate, almost always because a corporate proxy re-signs TLS with a private CA that the machine trusts but Git's bundled certificate store does not.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Look at what is actually being presented
openssl s_client -connect github.com:443 -showcerts </dev/null | head -20

# Point Git at the CA bundle that includes your proxy's root
git config --global http.sslCAInfo /etc/ssl/certs/ca-certificates.crt
# macOS with Homebrew git
git config --global http.sslCAInfo /opt/homebrew/etc/ca-certificates/cert.pem

# Add the corporate root once, system wide
sudo cp corp-root.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

# Do not do this: it disables verification for every host
# git config --global http.sslVerify false

How to diagnose Git errors

Git errors are frightening mostly because the messages describe internal state rather than what to do. The reassuring fact is that almost nothing is lost: git reflog records every position HEAD has held, so a bad rebase, a hard reset or a deleted branch is nearly always recoverable. Before running any destructive command, note the current commit hash.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Run git status and read it fully. It tells you the current state and usually names the exact command to move forward or abort.
  2. Use git reflog to find any commit you think you have lost, then git reset --hard <hash> or git branch recovery <hash> to get it back.
  3. For a rejected push, run git fetch then git log --oneline HEAD..@{u} to see exactly what is on the remote that you do not have. Prefer --force-with-lease over --force, which refuses to overwrite work you have not seen.
  4. Abort rather than improvise when a merge or rebase goes wrong: git merge --abort, git rebase --abort, git cherry-pick --abort.
  5. For repository corruption, run git fsck --full. If objects are missing, re-cloning and cherry-picking your local work is usually faster and safer than repairing in place.

Tools worth reaching for

  • git status
  • git reflog
  • git fsck --full
  • git log --graph --oneline --all
  • git diff --check

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

git-scm.com

Related Git errors

See all 20 Git errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.