Git: fatal: Pathspec is in submodule

后端 未结 5 1751
感情败类
感情败类 2020-12-02 05:04

I\'m trying to get TravisCI to automatically deploy my Hakyll static site, according to this guide.

Here\'s how my repo is set up. I have my source branch, which con

5条回答
  •  甜味超标
    2020-12-02 05:35

    Removing the directory from git and adding it again worked for me:

     git rm --cached directory
     git add directory
    

    This works if you purposefully removed the .git directory because you wanted to add directory to your main git project. In my specific case, I had git cloned an extension and ran git add . without thinking too much. Git decided to create a submodule, which I didn't like. So I removed directory/.git and ran into Git: fatal: Pathspec is in submodule. I couldn't find out how to remove the submodule stuff. Fixed with the two lines above.

提交回复
热议问题