knia
knia

Reputation: 749

`git remote` lists 'origin' after removal

How is the following output possible? git remote is still showing 'origin', after it has been removed:

$ git remote -v
origin

$ git remote remove origin
error: No such remote: 'origin'

I can add another 'origin', and remove it, but it is still listed afterward:

$ git remote add origin ../  # some arbitrary path

$ git remote -v
origin  ../ (fetch)
origin  ../ (push)

$ git remote remove origin

$ git remote -v
origin

The .git/config file is

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true

EDIT

As Michele De Falco guessed, I have something in my config:

$ git config --global --list | grep origin
remote.origin.prune=true

After removing it, the output of git remote -v is empty, as expected.

Upvotes: 1

Views: 61

Answers (1)

Michele De Falco
Michele De Falco

Reputation: 257

Run git config --global --list and git config --system --list, if origin is there then run git config --global --unset remote.origin.url

Upvotes: 4

Related Questions