Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove (null) git Remote

Tags:

git

git-remote

$ git remote -v
(null)  [email protected]:username/Savvy.git (fetch)
(null)  [email protected]:username/Savvy.git (push)
origin  [email protected]:username/SavvyCode.git (fetch)
origin  [email protected]:username/SavvyCode.git (push)

How can we delete the (null) remote above? Thanks.

like image 940
moey Avatar asked Apr 27 '12 08:04

moey


People also ask

How do I delete a Git remote in Linux?

Option 1: Remove a Git Remote Using Command Line. 1. To delete a git remote using the command line, first cd into the directory of the repository which contains the remote: 2. To list the available remotes and their URLs in the folder, type git remote -v: 3. Delete a remote with the following command: git remote remove [remote name] 4.

When should I use the delete command in Git?

Use it only when you are absolutely sure you want to delete a local branch. If you didn't merge it into another local branch or push it to a remote branch in the codebase, you will risk losing any changes you've made. Remote branches are separate from local branches. They are repositories hosted on a remote server that can be accessed there.

How to prune multiple remotes in Git?

With --prune option, run pruning against all the remotes that are updated. The remote configuration is achieved using the remote.origin.url and remote.origin.fetch configuration variables. (See git-config [1] ).

How to delete a local branch in Git?

Local branches are branches on your local machine and do not affect any remote branches. The command to delete a local branch in Git is: git branch is the command to delete a branch locally. -d is a flag, an option to the command, and it's an alias for --delete.


2 Answers

Look at the .git/config file (".git" is a subdirectory in your project's directory). It's an INI-style file which contains a section for each remote, which look like this:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = <REPOSITORY_URL>

So look for strange-looking remotes.

like image 200
kostix Avatar answered Sep 24 '22 03:09

kostix


Or you can use the CLI and remove it by doing this command:

git remote rm "(null)"
like image 29
Marz Avatar answered Sep 26 '22 03:09

Marz