“fatal: Not a git repository (or any of the parent directories)” from git status

后端 未结 13 2284
深忆病人
深忆病人 2020-12-04 14:54

This command works to get the files and compile them:

git clone a-valid-git-url

for example:

git clone git://cfdem.git.sour         


        
13条回答
  •  时光说笑
    2020-12-04 15:42

    I suddenly got an error like in any directory I tried to run any git command from:

    fatal: Not a git repository: /Users/me/Desktop/../../.git/modules/some-submodule

    For me, turned out I had a hidden file .git on my Desktop with the content:

    gitdir: ../../.git/modules/some-module

    Removed that file and fixed.

提交回复
热议问题