How can I move a single directory from a git repository to a new repository whilst maintaining the history?

You can use git filter-branch to rewrite the history of a project. From the documentation:

To rewrite the repository to look as
if foodir/ had been its project root,
and discard all other history:

git filter-branch --subdirectory-filter foodir -- --all

Make several copies of your repo, do that for each subdirectory you want to split out, and you should wind up with what you’re looking for.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)