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

后端 未结 8 744
无人及你
无人及你 2020-12-02 12:24

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

8条回答
  •  情书的邮戳
    2020-12-02 12:24

    In my case the problem was the .git/HEAD file didn't point anywhere, it just contained a sequence of strange characters. I copied the contents of .git/ORIG_HEAD to .git/HEAD and it worked again.

    Source

提交回复
热议问题