If you git svn clone http://svnhost/parent-proj
, you will not get a history with a copy-parent name for b
or c
. git svn
interprets the base path you provided as the smallest point that you are interested in smoothing out the SVN record by doing Git for the same. Since the historical commits in b
and c
are outside this path, git svn
will not reflect them, so you will not have this story.
Take a look at the documentation for the git svn init --no-minimize-url
:
When tracking multiple directories (using the --stdlayout, --branches or --tags options), Git svn will try to connect to the root (or the most acceptable level) Subversion repository. This default value allows you to better track history if entire projects are moved to repositories, but can cause problems with repositories where read access restrictions exist. Passing --no-minim-url will allow Git svn to accept URLs as is, without trying to connect to a higher level directory. This option is disabled by default when only one URL / branch is tracked (this will be of little use).
Since your clone
command does not specify multiple branches (possibly because you have a complex, multi-project or non-standard layout), git svn
just clones the commit associated with this path down. Shadow Creeper used the -s
or --stdlayout
-s
in the comments, which might explain why some kind of story was saved for them.
If this is a one-time conversion (one-way moving from SVN to Git), then you should probably clone the entire repository, then you have good options for moving things to Git to see the path you want them to, including creating historical branches and tags. If the motivation to run filter-branch
is to preserve the repository space, make sure that it will actually save you, and that it is worth it. Git is very storage efficient.
One final warning about pending search history in a Git clone. Look for the history in the file with git log -C --follow <file-path>
and Git, usually do a good job of finding and providing history including renames and copies. Do not expect the same for directories, for example. parent-proj/b
. Git tracks drops (files), trees (from blocks), commits and parent commits, but does not treat directories or directory copies in the same way as SVN.
source share