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

后端 未结 5 1241
醉梦人生
醉梦人生 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:34

    I ran into this error after I moved a git repository to a different folder. When I looked in:

    {submodule}/.git
    

    I saw a single line with an absolute path, e.g.:

    gitdir: /Users/ajx/Documents/repo/.git/modules/{submodule}
    

    I changed this to a relative path, e.g.:

    gitdir: ../../.git/modules/{submodule}
    

    I'm not sure why git would hardcode absolute paths...

提交回复
热议问题