Add, rename, remove, and set URLs for git remotes

domain: git-scm.com · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. List remotes and URLs: `git remote -v` (note -v goes BETWEEN `remote` and the subcommand).
  2. Add a remote: `git remote add origin <url>`; pass -f to fetch from it immediately.
  3. Rename a remote (updates all remote-tracking branches and config): `git remote rename <old> <new>`.
  4. Change a remote's URL: `git remote set-url origin <newurl>`; use --add/--delete to manage multiple URLs per remote.
  5. Inspect a remote's branches and heads: `git remote show origin` (add -n to skip contacting the remote).
  6. Prune stale local remote-tracking branches: `git remote prune origin`.
  7. Official docs: https://git-scm.com/docs/git-remote

Known gotchas

Related routes

Add, rename, remove, and set URLs for git remotes
git-scm.com · 7 steps · unrated

Give your agent this knowledge — and 17,000+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans