git status returns fatal: Not a git repository but .git exists and HEAD has proper permissions

These two files contains absolute submodule path:

{submodule}/.git
.git/modules/{submodule}/config

So, if you moved the repo, the absolute path in these two files are not valid, and cause the ‘not a git repository’ error. Just fix these files manually.

Leave a Comment