How to “resolve fatal: Not a git repository”?

后端 未结 5 1261
醉梦人生
醉梦人生 2021-02-01 13:53

I was trying to remove one sub-module from the project

Tried rm -rf .git/modules/submodulePath

After that I am having the issue

5条回答
  •  温柔的废话
    2021-02-01 14:21

    I've just hit this problem.

    In my case, this was due to checkout branches with different submodules.

    • One branch has some submodules, but
    • the other has 2 more submodules.

    For some reason, they were impossible to initialize with:

    git submodule update --recursive --init

    I've needed to manually delete this files/diretories before update worked properly.

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

提交回复
热议问题