(Comments)

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

These examples assume you're cloning using HTTPS, which is recommended.

$ git remote -v
# View current remotes
> origin  https://github.com/OWNER/REPOSITORY.git (fetch)
> origin  https://github.com/OWNER/REPOSITORY.git (push)
> destination  https://github.com/FORKER/REPOSITORY.git (fetch)
> destination  https://github.com/FORKER/REPOSITORY.git (push)

$ git remote rm destination
# Remove remote
$ git remote -v
# Verify it's gone
> origin  https://github.com/OWNER/REPOSITORY.git (fetch)
> origin  https://github.com/OWNER/REPOSITORY.git (push)

Note: git remote rm does not delete the remote repository from the server. It simply removes the remote and its references from your local repository.

Troubleshooting

You may encounter these errors when trying to remove a remote.

Could not remove config section 'remote.[name]'

This error means that the remote you tried to delete doesn't exist:

$ git remote rm sofake
> error: Could not remove config section 'remote.sofake'

Check that you've correctly typed the remote name.

Currently unrated

Comments

Most Recent

Recent Posts

The reason why I am not updating my MaOs into Catalina yet

1 month ago

How to count average by ignoring the #N/A

1 month ago

AVERAGE ignore NA()

read more

How to remove the remote origin in git

1 month ago

Xiaomi air purifier replacement

1 month, 1 week ago

The web browser, what the creature is that

1 month, 1 week ago

The web is part of the internet

1 month, 1 week ago

Web

We have seen how computers connected on the Internet communicate in different languages called protocols, to exchange emails, files, chat messages…

read more

Internet is the giant computer network

1 month, 1 week ago

The Internet is not the same as the Web. The Internet is bigger, older, and more varied.

read more