Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: Receiving "fatal: Not a git repository" when attempting to remote add a Git repo

Tags:

git

I am introducing myself to Git by following this tutorial:

  • getting jekyll running on nearlyfreespeech.net

Everything works fine up until the part where the repo is added to my local machine:

git remote add nfsn ssh://USERNAME@NFSNSERVER/home/private/git/REPONAME.git 

(After replacing USERNAME, NFSNSERVER, and REPONAME with the correct names) I receive the following error:

fatal: Not a git repository (or any of the parent directories): .git 

Can you help me get past this step?

like image 957
Corey Avatar asked Jan 07 '11 22:01

Corey


People also ask

How do I fix a fatal Not a git repository?

Check that you correctly created the repo. If the directory doesn't contain a . git repo, use git init to properly initialize the repo or clone an existing repo. Make sure your HEAD file contains the correct information on your current branch.

How resolve fatal Cannot be read from remote repository?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.

How do I add a remote repository in git?

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A unique remote name, for example, “my_awesome_new_remote_repo” A remote URL, which you can find on the Source sub-tab of your Git repo.


1 Answers

Did you init a local Git repository, into which this remote is supposed to be added?

Does your local directory have a .git folder?

Try git init.

like image 181
Assaf Lavie Avatar answered Oct 07 '22 11:10

Assaf Lavie