Skip to content
Latchkey

pre-commit "The unauthenticated git protocol ... is no longer supported" in CI

pre-commit cloned a hook repo using the plain git:// protocol and the host now refuses it. GitHub disabled the unauthenticated git protocol, so the fetch fails while setting up the hook.

What this error means

Setting up a hook repo fails with "The unauthenticated git protocol on port 9418 is no longer supported" during the clone step of pre-commit env setup.

pre-commit
fatal: unable to access 'git://github.com/owner/hook-repo/':
The unauthenticated git protocol on port 9418 is no longer supported.

Common causes

A hook repo URL uses git:// instead of https://

The repo: in the config, or a global git insteadOf rule, forces the unauthenticated protocol GitHub has disabled.

A git insteadOf rewrite maps https to git protocol

A url.git://.insteadOf config on the runner rewrites clone URLs to the retired protocol.

How to fix it

Use https for hook repos

  1. Change any git:// repo URLs in the config to https://.
  2. Remove any insteadOf rule that forces the git protocol.
  3. Re-run so the clone uses https.
.pre-commit-config.yaml
- repo: https://github.com/owner/hook-repo
  rev: v1.2.0
  hooks:
    - id: my-hook

Rewrite git protocol to https at the git layer

If a hook repo hardcodes the old protocol, add a global rewrite to https.

Terminal
git config --global url."https://github.com/".insteadOf "git://github.com/"

How to prevent it

  • Always reference hook repos over https.
  • Avoid insteadOf rules that map to the git protocol.
  • Cache PRE_COMMIT_HOME so hook repos are cloned once.

Frequently asked questions

What causes ""unauthenticated git protocol ... no longer supported""?
The repo: in the config, or a global git insteadOf rule, forces the unauthenticated protocol GitHub has disabled.
How do I fix "unauthenticated git protocol ... no longer supported"?
Use https for hook repos

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card