

Also make sure you have not mistyped the path to the repo. You can check the current folder with ls in Linux or dir in Windows. To solve the first two situations, in which you are in the wrong directory or mistyped the path to the repo, check the folder in which you are currently trying to run the command.

To fix “fatal: not a git repository”, try these steps Make sure you have navigated to the right directory git/HEAD and see that the HEAD branch is working properly and includes the branch you are working on. Your HEAD file is corrupted: You can run the command cat.You didn’t initialize the Git repository: You are in the project directory, but you didn’t initialize the Git repository for that project folder.

You mistyped the path to the repo: Double check your git command and make sure you typed the correct path.You are in the wrong working directory: You tried to run the command but did not navigate to the project folder where the git repository (git folder) is located.There can be a few reasons why the error occurs: The fatal: not a git repository error makes it clear that you’re not in a git repository. Why does the “fatal: not a git repository” error occur? Preventing “fatal: not a git repository”Ĭ.To fix “fatal: not a git repository”, try these steps.Why does the “fatal: not a git repository” error occur?.
#Cannot see git clone command in gerrit how to#
See more details below on the reasons for the fatal: not a git repository error, how to fix it, and our suggestions for preventing this annoying error in the first place.
