How do I add a submodule to a sub-directory?

前端 未结 5 1047
萌比男神i
萌比男神i 2020-12-02 03:36

I have a git repo in ~/.janus/ with a bunch of submodules in it. I want to add a submodule in ~/.janus/snipmate-snippets/snippets/, but when I run

5条回答
  •  星月不相逢
    2020-12-02 04:03

    For those of you who share my weird fondness of manually editing config files, adding (or modifying) the following would also do the trick.

    .git/config (personal config)

    [submodule "cookbooks/apt"]
        url = https://github.com/opscode-cookbooks/apt
    

    .gitmodules (committed shared config)

    [submodule "cookbooks/apt"]
        path = cookbooks/apt
        url = https://github.com/opscode-cookbooks/apt
    

    See this as well - difference between .gitmodules and specifying submodules in .git/config?

提交回复
热议问题