I have a Git repository with multiple branches. I'm looking to take certain folders from one of the branches and create a new repository with just those folders. What's the best way to do this while keeping my history for those folders intact?
Asked
Active
Viewed 380 times
2 Answers
3
For certain definition of 'intact', you can create a history of commits which only contains a given folder by using git filter-branch
with the --subdirectory-filter
option.
See this previous SO question: Detach (move) subdirectory into separate Git repository
-
This is also described in Github help: http://help.github.com/split-a-subpath-into-a-new-repo/ – dmedvinsky Oct 08 '11 at 20:05
0
Best and easiest way I can think of is to clone the existing repository and just delete all the folders you don't want to keep in the new repo.

BenBtg
- 836
- 1
- 9
- 22