I am introducing myself to Git by following this tutorial:
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?
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.
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.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With