WARNING: Work in progress
You can use `git subtree` to extract only one part of your repository, including its history. Here's a complete example on how to create new repositories from one repository with multiple directories.
Your initial repository structure looks like:
```
├── dir1
│ ├── myfile1
│ ├── myfile2
│ └── myfile3
├── dir2
│ ├── myfile1
│ ├── myfile2
│ ├── myfile3
│ └── myfile4
└── dir3
└── myfile
```