Git repository of subfolder -


i have project has repository. have root folder of repo,

/a /a1 /a2 /b /b1 

i want seperate folder different repository, want repository, looks same 1 described above, instead of folder a, want folder a submodule of repository created. independent project, , other repo depends on submodule a, contains b.

how should that? or have create whole new project losing commits?

thanks already!

you can clone repository , use git filter-branch remove history don't want both repositories. after that, can add submodule b.

edit: after following github guide,

git filter-branch --tree-filter "rm -rf a" --prune-empty head remove history of b.

edit: this question has comprehensive answer.


Comments