Nested git repositories without remotes (a.k.a. git submodule without remotes)

前端 未结 3 1784
长发绾君心
长发绾君心 2020-12-01 01:27

I have a project of which I am interested in breaking out portions as open-source. I\'ve set up nested git repositories main, one, two and three:

main/
├── on         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 01:57

    I just came up with the idea to place the repository of the submodules exactly as a subdirectory of the superproject. That way, the project as a whole is only dependent on the one repository/ location that you set up (based on the answer from Chris).

    E.g. Submodule one would have as its main repository the location server:/path/to/your/main/one (via git remote -v in that dir).

    That way the submodule functionality (e.g. git submodule update --recursive) is pointed to the right location as well since the URL of that module/repository points to ./one (.gitmodules).

提交回复
热议问题