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.
In the GUI the same delete is the Git remotes tab's Bulk actions → Delete Git remotes…, with the same refusals and the same kept-row outcome reported.
Flags
| Flag | Meaning |
|---|---|
--confirm | Actually 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
| Code | Meaning |
|---|---|
| 0 | Deleted, credentials removed, or previewed. |
| 1 | The remote was not found, or the server refused the delete (still referenced). |
| 2 | Usage 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.