> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to update git remotes
- URL: https://til.codes/how-to-update-git-remote/
- Published: 2015-07-13T07:38:01.000Z
- Updated: 2015-07-13T10:26:42.000Z
- Author: Manu Ajith
- Tags: til, git, #Import 2024-07-13 21:01

To list the existing remotes, we can use the following command:

```
git remote -v
#View existing remotes
origin  https://github.com/user/repo.git (fetch)
origin  https://github.com/user/repo.git (push)

```

Use the following command to set the remote to a new end point.

```
git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL

```

Making sure that worked ;)

```
git remote -v
# Verify new remote URL
# origin  https://github.com/user/repo2.git (fetch)
# origin  https://github.com/user/repo2.git (push)

```

Reference: [Github](https://help.github.com/articles/changing-a-remote-s-url/?ref=til.codes)