On Thu, Apr 10, 2014 at 12:11 AM, Phil Cruz <philc...@gmail.com> wrote:
> On Tuesday, April 8, 2014 1:24:08 AM UTC-7, Magnus Therning wrote:
>>
>> On Tue, Apr 8, 2014 at 1:16 AM, Phil Cruz <phil...@gmail.com> wrote:
>> > On Thursday, April 3, 2014 12:46:41 PM UTC-7, Magnus Therning wrote:
>> >> On Thu, Apr 03, 2014 at 10:28:12AM -0700, Phil Cruz wrote:
>> >> > I need some guidance on how to import our existing SVN repo to Git.
>> >> > The
>> >> > structure of the repo is not exactly standard. Say we have 2 versions
>> >> > of
>> >> > our app in the repo, Version1, the currently shipping version and
>> >> > Version2,
>> >> > the next version in development. The SVN structure is like
>> >> >
>> >> > /branches
>> >> >     /Version1_some_branch
>> >> >     /Version2_feature_branch1
>> >> >
>> >> > /tags
>> >> >     /Version1
>> >> >         /build_1
>> >> >         /build_2
>> >> >     /Version2
>> >> >         /build_1
>> >> > /releases
>> >> >     /Version1
>> >> >         /Release_1.0
>> >> >         /Releale_1.1
>> >> > /trunk
>> >> >     /Version1
>> >> >     /Version2
>> >> >
>> >> >
>> >> > There's actually more but this conveys the basic structure. I'm fine
>> >> > with not trying to migrate the entire repo with all the history and
>> >> > tags and releases. There's a lot of extraneous stuff like binary
>> >> > files and I think we'll be better off to start relatively clean. If
>> >> > possible I would like to import the working trunks/branches with
>> >> > history. So something like
>> >> >
>> >> > /trunk/Version1 becomes the "master" branch
>> >> > /trunk/Version2 becomes "Version2" branch
>> >> > /branches/Version2_feature_branch1 becomes "Version2_feature_branch1"
>> >> > /branches/Version1_some_branch becomes "Version1_some_branch"
>> >> >
>> >> > Is there a way to do something like that?
>> >>
>> >> I'd consider that layout very ordered and clean actually. :)
>> >>
>> >> If you are looking at using git-svn for the conversion, then pay
>> >> notice to this part of the man-page:
>> >>
>> >>   You can specify more than one --tags and/or --branches options, in
>> >>   case your Subversion repository places tags or branches under
>> >>   multiple paths.
>> >>
>> >> This seems to be exactly the thing you need.
>> >>
>> >> If you are looking at using subgit then it too allows for picking up
>> >> tags and branches in multiple places.
>> >
>> > So I'm doing git svn clone --prefix=svn/ clone file:///path/to/svn/
>> > new_git_repo --trunk=trunk/Version1 -b branches -b trunk/Version2
>> >
>> > everything in /branches is coming over but trunkVersion2 is not showing
>> > up
>> > as a branch. Any ideas?
>>
>> Hmm, yes, that's a bit interesting.  I don't have a good sized SVN
>> repo to play with, but on a small toy one I seem to get what you want
>> using the following:
>>
>> ~~~~
>> % git svn clone --prefix svn/ --trunk trunk/Version1 --branches
>> branches --branches trunk file:///path/to/svn new_git_repo
>> ~~~~
>>
>> That is, to pick up ^/trunk/Version2 as a branch you need to tell
>> git-svn to look for branches in ^/trunk.  It then seems to do the
>> right thing and realise that ^/trunk/Version1 already is designated as
>> TRUNK and skips it.  Rather funky that it worked.
>>
>> /M
>
>
> Thanks for taking the time to try to reproduce this. Your suggestion didn't
> work in my case. I ended up just copying the /trunk/Verion2 to /branches and
> it came in with the other branches.

Yes, of course, that would be the easiest way to achieve the end goal
:)  I'm glad you got to a place where you can start using git in
earnest.  Just beware, if you are new to Git, it is a bit addictive
and going back to SVN can be a real cause of pain once you're used to
Git ;)

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to