# Add or Set Remote URL

Note:- You can create a local git repo with "git init" command. Then you wont have the remote repository set. In that case you can add a remote repository with the following command.

```
git remote add origin https://github.com/USERNAME/REPOSITORY.git
  -- or --
git remote add origin git@github.com:USERNAME/REPOSITORY.git
```

If you want to change the url of an existing remote repository:

```
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
  -- or --
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
```

To find remote repo&#x20;

```
git remote -v
```

<https://stackoverflow.com/questions/42830557/git-remote-add-origin-vs-remote-set-url-origin>


---

# 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://www.git-help.com/commands/add-or-set-remote-url.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.
