Renaming a remote on GIT

Use the git remote rename command to rename an existing remote.

The git remote rename command takes two arguments:

  • An existing remote name, for example, origin
  • A new name for the remote, for example, destination


# view existing remotes of a repo
$ git remote -v
> origin (fetch)
> origin (push)

# change remote name from 'origin' to 'github'
$ git remote rename origin github

# Verify it
$ git remote -v
> github (fetch)
> github (push)

Get in touch 👋

Feel free to email me about anything. Want some advice? Give some feedback?

You can also reach me around the web: GitHub, LinkedIn, Twitter, DEV, Facebook, Instagram, CodePen