ProjectStack
git

fatal: not a git repository

You ran a Git command in a directory that hasn't been initialized as a Git repository. Git needs a .git folder to track changes, and this directory doesn't have one.

Common causes

  • You're in the wrong directory — navigate to your project folder first
  • The repository was never initialized with git init
  • The .git folder was accidentally deleted
  • You cloned a project but are in a parent or sibling directory

How to fix it

  1. cd into your project directory: cd /path/to/your/project
  2. Initialize a new repo if needed: git init
  3. Check your current directory: pwd (Mac/Linux) or cd (Windows)
  4. If the .git folder was deleted, clone the repo again: git clone <url>

Example

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

Running git status from a directory that isn't a Git repo

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.