当我在我的仓库上运行git status时,我得到了 fatal: Not a git repository: /my repo/.git/modules/docs
我已经检查过.git并且包含具有适当权限的HEAD.我可以运行各种其他命令.如果我运行git gui它打开正常并将列出一些已更改的文件,但是缺少很多文件.
我猜测HEAD可能存在某种腐败现象,但不确定.知道如何在不消除整个回购的情况下解决这个问题吗?
更新:我意识到我已经更改了repo目录的名称.错误中引用的目录是目录的旧名称.所以我目前的回购是在,/new dir/.git但错误是说Not a git repository: /old dir/.git/modules/docs.也许git很困惑?
我是Git的新手,并尽我所能找到关于这个问题的一些文档无济于事.
这是我的命令:
$ git submodule add https://github.com/joliver/EventStore.git externalsource/JOliverEventStore/
Run Code Online (Sandbox Code Playgroud)
致命:不是git存储库:../.git/modules/externalsource/JOliverEventStore无法签出子模块'externalsource/JOliverEventStore'
我在我的回购根目录中,目前没有目录/externalsource/JO
liverEventStore/.错误是谈论我不知道的目录.
如果我将子模块添加到根目录,如下所示:
$ git submodule add https://github.com/joliver/EventStore.git JOliverEventStore
Run Code Online (Sandbox Code Playgroud)
我没有问题,它在根目录中创建了该文件夹.
任何见解将不胜感激.