---
title: Change remote origin in git repo
author: Max Gialanella
date: 2023-03-02 01:58:28
tags:
---

Sometimes you need to change the remote origin in a git repo, if the server moves or if you just get better at NGINX and change the URL to something cleaner. Here are the simple steps on how to update your remote origin.

##### List remote origins

`git remote -v`

##### Add new remote origin

`git remote set-url add origin https://sweetNewDomain/git/user/RepoName`

##### Remove old origin

`git remote set-url delete origin 192.168.1.33:3030/git/user/RepoName`

##### List remote origins again

`git remote -v`

Verify that your URLs are correct and do a `git fetch` make sure everything is working. On your next push, you will need to re-enter your username and password.
Nice work!
