DEV Community

Daniel Felix
Daniel Felix

Posted on • Originally published at danielfelix.in

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

Example

# view existing remotes of a repo
$ git remote -v
> origin    git@github.com:itsdanielfelix/my-awesome-repo.git (fetch)
> origin    git@github.com:itsdanielfelix/my-awesome-repo.git (push)

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

# Verify it
$ git remote -v
> github    git@github.com:itsdanielfelix/my-awesome-repo.git (fetch)
> github    git@github.com:itsdanielfelix/my-awesome-repo.git (push)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)