How to change the remote repository for a git submodule?

后端 未结 7 1229
醉梦人生
醉梦人生 2020-11-22 10:45

I\'ve created a git repository with a submodule in it. I\'m able to tell the submodule itself to change its remote repository path, but I\'m not sure how to tell the parent

7条回答
  •  长发绾君心
    2020-11-22 11:32

    In simple terms, you just need to edit the .gitmodules file, then resync and update:

    Edit the file, either via a git command or directly:

    git config --file=.gitmodules -e
    

    or just:

    vim .gitmodules
    

    then resync and update:

    git submodule sync
    git submodule update --init --recursive --remote
    

提交回复
热议问题