Swap git submodule with own fork

后端 未结 2 814
遇见更好的自我
遇见更好的自我 2021-01-30 13:24

I added a submodule to my git repo like this:

$ git submodule add git://github.com/user/some-library some-library

I\'ve decided I want to creat

2条回答
  •  花落未央
    2021-01-30 13:54

    The submodules are stored in .gitmodules:

    $ cat .gitmodules
    [submodule "ext/google-maps"]
        path = ext/google-maps
        url = git://git.naquadah.org/google-maps.git
    

    If you edit the url with a text editor, you need to run the following:

    $ git submodule sync
    

    This updates .git/config which contains a copy of this submodule list (you could also just edit the relevant [submodule] section of .git/config manually)

    There might be a way to do it with only git commands, although the submodule system seems a bit incomplete (e.g see the instructions to remove a submodule)

提交回复
热议问题