Skip to main content
Version: v5.6.1

opschain git-credentials test

Included from Basic tier

opschain git-credentials test <id|name> --url <url> [--project <code>]

Asks the server to probe the credential against a repository URL (git ls-remote with the stored values) — the proof a rotated or freshly created credential works before any remote depends on it. The credential is addressed by id or by its name within the scope (--project <code>, or the global registry without it; a project scope reaches the project's own and the global credentials).

The outcome is reported either way: git credential <ref> authenticated against <url> on success, or the server's classified, credential-free failure reason with exit 1 — an unreachable or refusing remote is a completed probe, not a request failure. Each probe is audited (api:git_credentials:test, naming the URL and outcome, never a value).

Flags​

FlagMeaning
--url <url>The repository URL to probe the credential against (required).
--project <code>The project whose registry holds the credential. Omit for the global registry.

-o json|yaml prints {success, failure_reason, url} and exits 0 either way, so scripts read the outcome from the document.

Exit codes​

CodeMeaning
0The probe authenticated (or `-o json
1The probe failed (the reason is printed), the credential was not found, or the request failed.
2Usage error — missing --url, no server target.

Named errors​

  • --url is required: the repository URL to probe the credential against — exit 2.
  • git credential <ref> failed against <url>: <reason> — the probe's classified failure (exit 1).

Examples​

opschain git-credentials test github-ci --project acme --url https://github.com/acme/infra.git
git credential github-ci authenticated against https://github.com/acme/infra.git

See also​

  • opschain docs cli/git-credentials-update — rotate, then test.
  • opschain docs resources/git_credential — the probe's classification.