Changing the Remote URL(URI) in git for remote repository

git remote set-url command is used to change the remote url.

Example

git remote set-url origin https://github.com/USERNAME/REPOSITORY_xyz.git

The above command sets the remote url to https://github.com/USERNAME/REPOSITORY_xyz.git

Now, Your push,pull or fetch will be from this remote URL.To verify if its correctly set, Use following command

git remote -v

The above will output

# Verify new remote URL # origin https://github.com/USERNAME/REPOSITORY_xyz.git (fetch) # origin https://github.com/USERNAME/REPOSITORY_xyz.git (push)