Removing a remote from GIT

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)

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