# [BUG] git remote add failure

3 messages from 2007-10-18 to 2007-10-19. Participants: Guido Ostkamp, Johannes Schindelin, Shawn O. Pearce.
Thread: https://gitlist.dev/t/10355

## Guido Ostkamp, 2007-10-18 08:55

Subject: [BUG] git remote add failure
Message-ID: <1192697719.31199.1216526739@webmail.messagingengine.com>
URL: https://gitlist.dev/e/1192697719.31199.1216526739%40webmail.messagingengine.com

```
Hello,

I think I've found a bug in "git remote add". I tried the following:

$ git remote add -f spearce2 http://repo.or.cz/git/spearce.git
Cannot get the repository state from http://repo.or.cz/git/spearce.git
fetch spearce2: command returned error: 1

Obviously I used the wrong URI. Then I tried again:

$ git remote add -f spearce2 http://repo.or.cz/r/git/spearce.git
remote spearce2 already exists.

I think Git should not store the bad info and block the name when the
first call wasn't successfull.

Regards

Guido

```

## Johannes Schindelin, 2007-10-18 16:09

Subject: Re: [BUG] git remote add failure
Message-ID: <Pine.LNX.4.64.0710181708230.25221@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710181708230.25221%40racer.site
In-Reply-To: <1192697719.31199.1216526739@webmail.messagingengine.com>

```
Hi,

On Thu, 18 Oct 2007, Guido Ostkamp wrote:

> I think I've found a bug in "git remote add". I tried the following:
> 
> $ git remote add -f spearce2 http://repo.or.cz/git/spearce.git
> Cannot get the repository state from http://repo.or.cz/git/spearce.git
> fetch spearce2: command returned error: 1
> 
> Obviously I used the wrong URI. Then I tried again:
> 
> $ git remote add -f spearce2 http://repo.or.cz/r/git/spearce.git
> remote spearce2 already exists.
> 
> I think Git should not store the bad info and block the name when the
> first call wasn't successfull.

The problem there is of course that the fetch could fail because you are 
offline.  In that case, you do not want git remote to throw the 
information away.

BTW you missed the trailing slash in the HTTP URL, I guess.

Ciao,
Dscho

```

## Shawn O. Pearce, 2007-10-19 00:20

Subject: Re: [BUG] git remote add failure
Message-ID: <20071019002017.GP14735@spearce.org>
URL: https://gitlist.dev/e/20071019002017.GP14735%40spearce.org
In-Reply-To: <Pine.LNX.4.64.0710181708230.25221@racer.site>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Thu, 18 Oct 2007, Guido Ostkamp wrote:
> 
> > I think I've found a bug in "git remote add". I tried the following:
> > 
> > $ git remote add -f spearce2 http://repo.or.cz/git/spearce.git
> > Cannot get the repository state from http://repo.or.cz/git/spearce.git
> > fetch spearce2: command returned error: 1
> > 
> > Obviously I used the wrong URI. Then I tried again:
> > 
> > $ git remote add -f spearce2 http://repo.or.cz/r/git/spearce.git
> > remote spearce2 already exists.
> > 
> > I think Git should not store the bad info and block the name when the
> > first call wasn't successfull.
> 
> The problem there is of course that the fetch could fail because you are 
> offline.  In that case, you do not want git remote to throw the 
> information away.

Right.  But maybe there should be an easier way for the user to
"force" adding the remote over the existing remote.  Much like how
they can force creating a branch over an existing branch.

Too bad -f is already taken.  :-\

-- 
Shawn.

```
