git status returns fatal: Not a git repository but .git exists and HEAD has proper permissions
git
Solution
I finally sorted out that the issue was due to an issue with one of the submodules. Simply renaming the repo directory caused a conflict with that submodule. After seeing the discussion in How can I rename a git repository with submodules? I realized that cloning the repo is a better way to go instead of renaming the directory and that solved the issue with the submodule.
Problem
When I run git status on my repo I get `fatal: Not a git repository: /my repo/.git/modules/docs` I've checked and .git exists and contains HEAD with the proper permissions. I can run various other commands fine. If I run git gui it opens fine and will list a couple of the changed files, but is missing a lot of them. I'm guessing there may be some sort of corruption in HEAD, not sure though. Any idea how to fix this without wiping out the whole repo? Update: I realized that I had changed the name of the repo's directory. The directory being referenced in the error is the old name of the directory. So my current repo is at `/new dir/.git` but the error is saying `Not a git repository: /old dir/.git/modules/docs`. So maybe git is confused?