DEV Community

loading...

Removing a remote from 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 rm command to remove a remote URL from your repository.

The git remote rm command takes one argument:

  • A remote name, for example, destination

Example

# view all 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)
> gitlab    git@gitlab.com:itsdanielfelix/my-awesome-repo.git (fetch)
> gitlab    git@gitlab.com:itsdanielfelix/my-awesome-repo.git (push)

# Remove a remote
$ git remote rm gitlab

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

Discussion (0)