git-svn clone checkouts wrong repo?

前端 未结 4 1160
醉梦人生
醉梦人生 2020-12-14 00:18

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

相关标签:
4条回答
  • 2020-12-14 00:45

    Make sure that you specify a full path to myproject it seems like partial paths are not handled well by the fetch part of the clone operation. You may use the colon in that path on Windows (e.g. c:\myproject) (but may not use a colon in the source repository path).

    git svn clone path-to-repo/myrepo/myproject --stdlayout --prefix=svn myproject
    
    0 讨论(0)
  • 2020-12-14 00:46

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

    According to http://schacon.github.com/git/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).

    0 讨论(0)
  • 2020-12-14 00:53

    Meanwhile, I got it working with the usual -s switch:

    git svn clone -s <svn_repo_url>

    I also have a few git-svn references that I want to share:

    1. http://justaddwater.dk/2009/03/09/using-git-for-svn-repositories-workflow/
    2. http://www.viget.com/extend/effectively-using-git-with-subversion/
    3. http://utsl.gen.nz/talks/git-svn/intro.html
    4. http://trac.parrot.org/parrot/wiki/git-svn-tutorial
    0 讨论(0)
  • 2020-12-14 01:06

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

    0 讨论(0)
提交回复
热议问题