`fatal: not a git repository (or any of the parent directories): .git`
BeginnerTroubleshootingAuthentication and Remote Access
Answer
Likely causes → You are in the wrong directory, the repo was never initialised, or the .git folder was deleted.
Diagnose →
pwd
git rev-parse --show-toplevel
ls -la | grep .git
Fix → cd into the project, or run git init for a new one. If .git was removed, re-clone and copy your working files over.
Prevent → Show the branch in your shell prompt so you notice when you are outside a repo.
More on Authentication and Remote Access
`[email protected]: Permission denied (publickey).` followed by `fatal: Could not read from remote repository.`Beginner`remote: Support for password authentication was removed on August 13, 2021.`Beginner`fatal: Authentication failed for 'https://github.com/org/repo.git/'` with a token that worked last month.Beginner`WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!` when connecting to GitHub over SSH.Intermediate`remote: Repository not found.` for a repo you can open in the browser.Beginner`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.Intermediate