简体   繁体   中英

Open source git repo management

I maintain a front-end framework called Kickoff , it is similar in design to Bootstrap or Foundation. We currently maintain one main repo for the framework and another for a Yeoman generator. Our traditional process for updating both repos is write in one ( the framework repo ) and manually copy into the other ( the Yeoman generator ) - this is a painful process to manage to say the least, especially when there's a large release being planned.

I would like to split our codebase up in to much smaller chunks and then import them into both repos, what would be the best way to do this? A typical example for this use-case would be a to have the entire Sass folder in its own repo, and then a Sass module like the grid have its own repo too.

We have thought about git submodules, is that a good way to do it; or would another process such as automated/compiled builds be better?

If anyone reading this has experience with this type of thing, I would really appreciate some input.

A typical example for this use-case would be a to have the entire Sass folder in its own repo, and then a Sass module like the grid have its own repo too

git submodule is what you are looking for (as you found out already).

We have thought about git submodules, is that a good way to do it; or would another process such as automated/compiled builds be better?


From the doc :

Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.


As explained above the submodule content is fetched form a standalone repository to a folder inside your current repository. Any modification to the submodule folder will not appear in the root folder git status on the root folder will not display them.

So to summarize it: submodule is exactly what you need here.

在此处输入图片说明

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