This is a mini howto on moving a subdirectory to its own repository retaining history
Assume PARENT
is the original parent Git repository (locally) and CHILD
is the new local repository that you wish to create from a subdirectory, retaining all of its history from the PARENT
repository; PARENT_PATH
and CHILD_PATH
are the paths to PARENT
and CHILD
respectively; SUBDIR is the relative path within the repository under extraction:
git clone --no-hardlinks PARENT_PATH CHILD_PATH
pushd CHILD_PATH