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

Re: [Bug] Misleading error message when run in a non-Git directory

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 23, 2020, 23:26 UTC
Message-ID
<20200423232622.GK6465@camp.crustytoothpaste.net>
In-Reply-To
<c0e916fb-7b0e-1192-e71d-ea6449863e9b@narod.ru>
On 2020-04-23 at 22:42:25, Victor Porton wrote:
Show 10 quoted lines
> git remote add origin ...
> 
> produces the error
> 
> fatal: remote origin already exists.
> 
> when run in the directory which is not initialized by Git (has no .git
> folder).
> 
> This error message is misleading.

I don't see this, using a reasonably up-to-date version of next. What I see is the following:

  $ git remote add origin foo
  fatal: not a git repository (or any of the parent directories): .git

Are you running this in a directory under your home directory? If so, is your home directory a repository?

If not, can you tell us what running "git rev-parse --show-toplevel" in that directory prints?

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Victor Porton
Message 2 of 2 in “[Bug] Misleading error message when run in a non-Git directory”
  1. Victor PortonApr 23, 2020
  2. brian m. carlsonApr 23, 2020

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.