tags:

views:

558

answers:

2

So I am trying to switch to git, by using git-svn. I am having a svn repo called myrepo from which I want to clone just the project called myproject. The thing is that by running the following command:

git svn clone path-to-repo/myrepo/myproject --stdlayout --prefix=svn myproject

the whole repo myrepo is cloned rather than just myproject. I tried using -T, -t, -b as well to let git know about the layout of the project, but without any success. I always get the following output:

Using higher level of URL: path-to-repo/myrepo/myproject => path-to-repo/myrepo

and tries to clone that one. Am I doing something wrong? It might be that the svn repo layout could be broken or git incompatible ?

+4  A: 

You can try the --no-minimize-url option.

According to http://www.kernel.org/pub/software/scm/git/docs/git-svn.html
--no-minimize-url: When tracking multiple directories (using --stdlayout, --branches, or --tags options), git svn will attempt to connect to the root (or highest allowed level) of the Subversion repository. This default allows better tracking of history if entire projects are moved within a repository, but may cause issues on repositories where read access restrictions are in place. Passing --no-minimize-url will allow git svn to accept URLs as-is without attempting to connect to a higher level directory. This option is off by default when only one URL/branch is tracked (it would do little good).

kartikmohta
I can't find the --minimize-url option. I've tried with git 1.5.4.3 and git 1.6.0.4. Can you give me a little bit more details? Thanks.
hyperboreean
Aah... it's been added in git v1.6.4
kartikmohta
Is there something similar in the versions bellow 1.6.4?
hyperboreean
The minimize-url option set to 1 for all versions below 1.6.4, so I don't think there is anything available for the lower versions.Any problems in getting the new version?
kartikmohta
Yeah, I have many servers with git bellow 1.6.4 and it would be a pita to get the new version on each one.
hyperboreean
A: 

.gitconfig hack may help, but i dont know how to repopulate after : http://thread.gmane.org/gmane.comp.version-control.git/127528/focus=127776

rzr

related questions