Fix · GitHub and Git
fatal: not a git repository
What you may see
- Git commands say this is not a git repository
- I opened the terminal and typed git status in the wrong folder
Most likely cause
The terminal is in a folder that is not the project, or the project never had Git set up.
Check first (about two minutes)
- Run pwd to see the folder you are in, and ls -a to look for a .git folder.
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Run pwd and ls -a and show me the output.
- Help me find the real project folder (look for package.json) and cd into it.
- Only if the project truly has no .git anywhere, explain what git init does and ask me before running it.
Do not do this
- Do not run git init in the home folder or on the Desktop.
- Do not run git init inside a folder that is inside another repository.