DEV Community

loading...

Renaming a remote on GIT

Daniel Felix
Senior software engineer ❯ Experienced PHP Developer ❯ Laravel Expert ❯ WordPress ❯ Joomla❯ Js❯ AWS ❯ Continuous learner.
Originally published at danielfelix.in ・1 min read

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

Discussion (0)