I have a big repository which currently contains multiple projects in top level subfolders, say /a
, /b
, /c
, and /d
.
Now I want to split up that repository into two different repositories: one containing /a
and /b
and the other containing /c
and /d
.
I am aware of git filter-branch --subdirectory-filter
, which is perfect for extracting a single directory, but it seems not to be able to extract multiple directories at once.
I am also aware of git filter-branch --prune-empty --tree-filter
, which would allow me to delete everything, but the two wanted directories. This feels not completely right, as I have to manually specify all toplevel directories that might exist.
Is there a better way to extract two directories out of a big repository?
PS: Of course any good solution using something other than git filter-branch
is fine. ;)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…