10

our svn server has a trunk called Dev and Branches live in

/Branches/Release/1.0/
                 /2.0/
                 /2.3.4/

i cloned it with something like git svn clone -T Dev ... -b Branches ...
when I run git branch 2.1 remotes/Release/2.1 i get:
fatal: Not a valid object name: 'remotes/Release/2.1'.

  • How do I refer to the remote branch?
  • Do I need to re-clone with different args?
3
  • I think you're SOL bud :/ You imported one Branch: Release with folders in it. Commented Oct 21, 2010 at 0:21
  • How should I fix this for next time i clone? Commented Oct 21, 2010 at 0:22
  • Possible duplicate to stackoverflow.com/questions/258590/… Commented May 6, 2014 at 9:13

1 Answer 1

13

As mentioned in "How do I import svn branches rooted in different directories into git using git-svn?", you need to grab all the nested branch during the initial import:

[svn-remote "svn"]
    url = svn://svnserver/repo
    fetch = trunk:refs/remotes/trunk
    branches = branches/*/*:refs/remotes/*
    tags = tags/*:refs/remotes/tags/*

That is also described in this thread.
For even more complex SVN branch layout (like branches within trunk!), a modification of the SVN repo might be in order first, before putting in place a git-svn integration.

Since Git1.6, "1.6.x offers deep cloning so that multiple wildcards can be used with the --branches option", as mentioned in "Cloning a Non-Standard Svn Repository with Git-Svn".

git svn clone https://svn.myrepos.com/myproject web-self-serve --trunk=trunk --branches=branches/*/* --prefix=svn/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.