0

I have a project with a number of subfolders that I would like to use as submodules in either the current repository context (redefined as a superproject) or a newly created superproject.

The idea would be to take a folder like

/projectfold/subfold_a
/projectfold/subfold_b
/projectfold/subfold_c

and create submodules from this like

@subfold_a
@subfold_b
@subfold_c

with projectfold being redefined as

superproject <projectfold>

I have no idea what the best method of attack is for this, and I saw this answer just now. I'm not sure that it relates to my question here because it seems to only deal with a single folder moving to a new destination. I also read this article in which the preservation of history is maintained when moving folders/files from one project to another (desirable).
Should I be using a combination of these methods, or is there a better way to do this?

The goal would be to check out and push to each of the submodules more quickly since the superproject has become quite large and unmanageable w/r/t size.

jml
  • 1,745
  • 6
  • 29
  • 55
  • 2
    [Here's](https://stackoverflow.com/questions/13425260/rewrite-history-git-filter-branch-create-split-into-submodules-subprojects/54797306#54797306) what I use to split histories. You can push the resulting histories wherever you want, or you can just carry them as incorporated submodules, make branch refs and use `git worktree add` instead of `git submodule init` and …`update`. – jthill Feb 28 '20 at 19:54
  • Can you post this as an answer? I would like to check it out in detail, and notice that your answer was not marked "correct" based on the prior question's context. If this works I'd be happy to mark it correct. Many thanks! – jml Feb 28 '20 at 20:19

0 Answers0