Is there a way to create a new git repository from an existing one, the new repository should include only files located in the specified subfolder and only commits that affects these files?
+1
A:
I think you are looking for:
git filter-branch --subdirectory-filter foodir -- --all
(Example taken from the git documentation)
Chris Shaffer
2010-08-10 12:22:13
yes, that's almost it. but how can I keep my project root folder the same? I want all my files have their location unchanged
whitered
2010-08-10 13:54:57
To keep the location unchanged within the repository, you would probably use the --tree-filter parameter instead of the --subdirectory-filter, and pass a shell command that would delete everything except the directory you want to keep.
Chris Shaffer
2010-08-10 14:33:21