I have a generic git repository called Workspace and each project I have that isn't big enough to deserve its own repository is stored as a folder within it. One of my mini-projects is now big enough that I feel it should have its own repository. I could easily make this happen by just copying the latest revisions into their own repository and committing them, but this doesn't transfer any of the previous revisions or history to the new repository. Is there a way to take a subfolder of a repo and make it its own repo without losing history?I'm also fine with answers that only work for GitHub in case that has special features.
Making folder of a git repository a separate repository while preserving history
git;github
This is a common workflow; the Git team even added a command for it: git subtree will convert the directory into a submodule.See this StackOverflow answer for more details: Detach subdirectory into separate Git repository: The Easy Way.