Renaming a remote

suggest change

To rename remote, use command git remote rename

The git remote rename command takes two arguments:

Get existing remote name

git remote
# origin

Check existing remote with URL

git remote -v 
# origin (fetch)
# origin (push)

Rename remote

git remote rename origin destination
# Change remote name from 'origin' to 'destination'

Verify new name

git remote -v 
# destination (fetch)
# destination (push)

Posible Errors

  1. Could not rename config section ‘remote.[old name]’ to ‘remote.[new name]’

    This error means that the remote you tried the old remote name (origin) doesn’t exist.

  2. Remote [new name] already exists.

    A remote with such name already exists.

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents