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

前端 未结 5 1046
萌比男神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:12

    one-liner bash script to help facility Chris's answer above, as I had painted myself in a corner as well using Vundle updates to my .vim scripts. DEST is the path to the directory containing your submodules. Do this after doing git rm -r $DEST

    DEST='path'; for file in `ls ${DEST}`; do git submodule add `grep url ${DEST}/${file}/.git/config|awk -F= '{print $2}'` ${DEST}/${file}; done
    

    cheers

提交回复
热议问题