All fixes

Help, I get “not a git repository”

Git cannot find a repository in this folder or any folder above it. You are almost always just one cd away.

What Git says~/my-app
git status
fatal: not a git repository (or any of the parent directories): .git

The fix

  1. cd ~/projects/my-app

    Go into the folder that holds your project. After git clone, that is the folder the clone just created.

  2. git status

    Works now. If it still fails, ls -a should show a .git folder here.

~/projects/my-app is an example. Replace it with your own.

Why this works

Git looks for a hidden .git folder in the current folder and then in every parent. If there is none, it gives up with this message. After git clone, the repository is inside the new folder the clone created, so cd into it first. Only if the project is genuinely new should you run git init, and never in your home folder: that would turn your whole home directory into one giant repository.