Aug 102018

ADM

How to remove a remote from git

  • August 10 2018
  • ADM

 

 

How to remove a remote from git - git

 

To remove a remote you can use the command git remote rm in the terminal, from the root folder of your repository.

The git remote rm command has one parameters:

  • the existing remote name;

Rename

Will remove the gitlab remote. Note that the command will not delete the repository, just the local reference.

C:\Users\adm\repos\jersey-hello-world>git remote rm gitlab

To check the remote was removed run the following command:

C:\Users\adm\repos\jersey-hello-world>git remote -v
github  https://github.com/admfactory/jersey-hello-world.git (fetch)
github  https://github.com/admfactory/jersey-hello-world.git (push)

Errors

If the remote name doesn't exist the following error will occur:

error: Could not remove config section 'remote.gitlab'

References