How to change git submodules url locally?

前端 未结 3 653
执念已碎
执念已碎 2020-12-31 11:14

The original .gitmodules file uses the hard coded https urls but for some automated tests I clone from ssh and make the submodule urls

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 11:19

    I tried the above solution but had a mess of problems for some reason. The following is an alternative.

    In a new repository:

    1. git submodule init
    2. Initialize each submodule manually with git clone ../local/path/to/submodule.git path/in/repo/submodule

    Whenever the root repository submodule hashes change and you need to sync the submodules:

    1. Update the root repository
    2. git submodule update with maybe --force and --recursive for good measure

提交回复
热议问题