# Rename A Remote

If you just added a remote (`git remote add ...`) and messed up the name or just need to rename some existing remote, you can do so with the `rename` command.

First, let's see the remotes we have:

```bash
$ git remote -v
origin  https://github.com/jbranchaud/til.git (fetch)
origin  https://github.com/jbranchaud/til.git (push)
```

To then rename `origin` to `destination`, for example, we can issue the following command:

```bash
$ git remote rename origin destination
```

See `man git-remote` for more details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/tools/git/rename-a-remote.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
