git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to remove invalid remote repository

From
JHJan Hudec <bulb@ucw.cz>
Date
Jun 5, 2007, 20:14 UTC
Message-ID
<20070605201457.GB3240@efreet.light.src>
In-Reply-To
<8A00BB77B01133479F4A56D932A1132202906FD8@EX-401.mail.navisite.com>
On Tue, Jun 05, 2007 at 14:41:04 -0500, Matt Seitz wrote:
> I mistakenly entered the wrong directory name for "git remote add" (I
> entered the working tree directory name instead of the ".git" directory
> name). 

There does not seem to be any 'git remote remove'. So you'll do it by changing the config. Either with git-config, or by editing .git/config (it *IS* meant to be hand-edited).

Show 7 quoted lines
> [...]
> So, how can I remove the incorrect remote repository reference and
> replace it with a correct one?
> 
> [root@demo5 etc]# git config -l
> [...]
> remote.root-etc.url=/root/git/etc
                      ^^^^^^^^^^^^^
This is the URL. You can simply fix it either with 
    git-config remote.root-etc.url /root/git/etc/.git
or by editing
.git/config
> remote.root-etc.fetch=+refs/heads/*:refs/remotes/root-etc/*
The section corresponding to these two entries in .git/config looks like:

[remote "root-etc"] url = /root/git/etc fetch = +refs/heads/*:refs/remotes/root-etc/*

You can tweak it to your heart's content. The documentation is in man pages of git-config and git-fetch.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Matt SeitzNext: Linus Torvalds
Message 2 of 4 in “How to remove invalid remote repository”
  1. Matt SeitzJun 5, 2007
  2. Jan HudecJun 5, 2007
  3. Linus TorvaldsJun 5, 2007
  4. Matt SeitzJun 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.