简体   繁体   中英

create a sub-repository and insert it in the main project

I'm very new to git, I use it through gitHub, and I wanted to know if there's a way to create a sub-repository that is then included in the main one. For example, if I have a library with modules, I'd like some of them to be in a repository on their own, with issues and all the features offered by git, but at the same time I want them to be included in the library repo. How can I do this?

I think you are looking for git submodules .

Basically, each of the libraries you mention will be added as a submmodule. Each such submodule will have a repository of its own, and the master repository will reference this via the entry in the .gitmodules file.

As @Chris mentions in comments below, you may want to explore git subtrees as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM