How to git-svn clone specific subdirectories without the extra commit logs of the parent directory?

29 Views Asked by At

I have an SVN directory structure like this:

SVN
    HEAD
        PROJECT1
            project1 files
        PROJECT2
            project2 files
        PROJECT3
            project3 files
        PROJECT4
            project4 files
        ...

I want to create a Git repo like this:

Git
    PROJECT1
        project1 files
    PROJECT2
        project2 files

When I execute the following commands:

git svn init svn://my-svn-url --trunk HEAD --include-paths='^HEAD/(PROJECT1|PROJECT2)/' my-git
cd my-git
git svn fetch

I get the desired Git repo structure. However, when inspecting git log, I notice that the entire SVN log (commit history) of HEAD is included. But I only want the SVN log of PROJECT1 and PROJECT2 to be included in the git log result.

Any suggestions on how I could do this?

0

There are 0 best solutions below