Skip to main content
Version: v5.6.1

opschain git-remotes delete

Included from Basic tier

opschain git-remotes delete <project>/<name> --confirm

Deletes a Git remote. Deleting is permanent, so without --confirm the command only previews what would be deleted and exits 0 without touching anything.

The server guards the delete:

  • It refuses while templates, changes or scheduled changes reference the remote.
  • An archived remote still referenced by changes is not removed: its row is kept for the audit trail and its stored credentials are removed instead. The command reports this outcome explicitly.

Flags​

FlagMeaning
--confirmActually delete. Without it the command previews.

Output​

The preview (no --confirm):

would delete git remote demo/origin (0199a2c4-…)
url: https://github.com/acme/demo-config.git
deleting is permanent; the server refuses while templates, changes or scheduled changes
reference the remote, and an archived remote still referenced by changes keeps its row
with its credentials removed instead.
re-run with --confirm to delete

A full delete prints deleted git remote <project>/<name>. A credentials-only removal prints the server's messages followed by git remote <project>/<name> was kept; its stored credentials were removed.

Exit codes​

CodeMeaning
0Deleted, credentials removed, or previewed.
1The remote was not found, or the server refused the delete (still referenced).
2Usage error — malformed address, no server target.

Named errors​

  • expected <project>/<git-remote-name>, got "<arg>" — exit 2.
  • git remote "<name>" not found in project "<project>" — exit 1.
  • git remotes live on a server's projects — pass --server <url> or 'opschain context use <name>' — no server target (exit 2).

See also​

  • opschain docs cli/git-remotes-update — archiving a remote instead of deleting it.
  • opschain docs cli/templates-show — find which template versions pin the remote's repository.