• Register
1 vote
96 views

Problem :

I have recently started to learn the GIT. I was working on my GIT and suddenly I started facing below error.

Fatal: not a git repository (or any of the parent directories): .git”

As I am very new to GIT so I am unable to understand above error. I am trying to fix the error from past couple of days but unable to fix it.

Is there anyone who can spare some time and guide me to fix above error?

8 5 2
3,230 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have helped many beginners to fix their GIT related issues. I can certainly say that you are facing above error as you are trying to use the Git command and your current working directory is not within your Git repository. This is because by default your Git will look for your .git repository directory inside of your project root.

If you have already set the GIT_DIR environment variable then it will specify that the path to use instead of your default .git for your base of your repository.

So you need to either cd into your repository or if you haven’t yet initialize or cloned the repository already in that case you will have to initialize your repo in your directory where you actually want to place your repo with below command :

git init

OR you can clone a repository with below commands

git clone <remote-url>
cd <repository>
8 4 1
5,680 points

Related questions

0 votes
1 answer 5 views
5 views
Problem: how can solve this problem.,. fatal: not a git repository (or any of the parent directories):
asked Apr 1 Ifra 37.2k points
0 votes
1 answer 5 views
5 views
Problem: Please,I want an answer >Not a git repository or any of the parent directories
asked 1 day ago Chi Omega 21.7k points
0 votes
1 answer 7 views
7 views
Problem: I know my question looks similar to some questions, but I think that my problem is something new maybe. $ git init # Make a new repository $ git add -A # Add all the files which have not been added $ git commit -m "Initialize repository" $ git push ... fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Could you please give me some ideas?
asked Apr 26 sumaiya simi 43.9k points
0 votes
1 answer 7 views
7 views
Problem: Please let me know how to fix the issue.git fatal: could not read from remote repository.
asked Apr 17 ashik 14.6k points
1 vote
1 answer 146 views
146 views
Problem : I am unable to clone my Git repository, and getting below error: /c/Projects $ git clone http://stage.abc.com:10088/pqr http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or dir Please let me know any pointers to resolve my error.
asked Dec 30, 2019 alecxe 7.5k points
0 votes
1 answer 6 views
6 views
Problem: I am creating a Git repository and i get an error: fatal: 'origin' does not appear to be a git repository
asked Apr 2 ummesalma 29.2k points
0 votes
1 answer 7 views
7 views
Problem: I've cloned a private repo, forked it and made som changes into a feature branch. When I try to push these changes into the repo i get the following message: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the ... to push with git push --set-upstream origin but it's just showing me the same error. Have anyone of you seen this before?
asked Apr 24 sumaiya simi 43.9k points
0 votes
1 answer 5 views
5 views
Problem: What are my options for dealing with this issue:git could not read from remote repository?
asked Apr 17 ashik 14.6k points
0 votes
1 answer 4 views
4 views
Problem: Icould not read from remote repository git clone and getting the above eror . can somebody help?
asked Apr 8 Sana8989 8.9k points
0 votes
1 answer 85 views
85 views
Problem : I am unable to clone my Git repository and getting below error: ​/c/Projects $ git clone http://stage.abc.com:10088/pqr http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or directory ​ How can I fix the above error?
asked Jan 16, 2020 jwilliam 3.9k points