{"thread":{"id":"53303","subject":"[Bug] Misleading error message when run in a non-Git directory","startedAt":"2020-04-23T22:49:49Z","lastAt":"2020-04-23T23:26:29Z","messageCount":2,"participants":["Victor Porton","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"396060","messageId":"c0e916fb-7b0e-1192-e71d-ea6449863e9b@narod.ru","threadId":"53303","inReplyTo":null,"subject":"[Bug] Misleading error message when run in a non-Git directory","fromName":"Victor Porton","fromEmail":"porton@narod.ru","sentAt":"2020-04-23T22:42:25Z","receivedAt":"2020-04-23T22:49:49Z","isPatch":false,"sender":{"key":"porton@narod.ru","avatar":"https://gravatar.com/avatar/26fbbd66c3da4108798dc4fccb153ea484585216cc8f62e678c07a05e8dcd165?d=mp&s=160"},"body":"git remote add origin ...\n\nproduces the error\n\nfatal: remote origin already exists.\n\nwhen run in the directory which is not initialized by Git (has no .git\nfolder).\n\nThis error message is misleading.\n\ngit --version\ngit version 2.20.1\n\n"},{"id":"396065","messageId":"20200423232622.GK6465@camp.crustytoothpaste.net","threadId":"53303","inReplyTo":"c0e916fb-7b0e-1192-e71d-ea6449863e9b@narod.ru","subject":"Re: [Bug] Misleading error message when run in a non-Git directory","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-04-23T23:26:22Z","receivedAt":"2020-04-23T23:26:29Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-04-23 at 22:42:25, Victor Porton wrote:\n> git remote add origin ...\n> \n> produces the error\n> \n> fatal: remote origin already exists.\n> \n> when run in the directory which is not initialized by Git (has no .git\n> folder).\n> \n> This error message is misleading.\n\nI don't see this, using a reasonably up-to-date version of next.  What I\nsee is the following:\n\n  $ git remote add origin foo\n  fatal: not a git repository (or any of the parent directories): .git\n\nAre you running this in a directory under your home directory?  If so,\nis your home directory a repository?\n\nIf not, can you tell us what running \"git rev-parse --show-toplevel\" in\nthat directory prints?\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}