How to extract a subdirectory of an existing Git repository into its own Git repository
I ran into this problem recently so I figured I would post a step by step solution. Say you have a project stored in Git with three subdirectories like this: project/ .git/ folder1/ folder2/ folder3/ And you want to extract the contents of folder3 into its own Git repository, like this: project/ .git/ folder1/ folder2/…