tags:

views:

47

answers:

1

I am trying to import a svn repository that follows the standard svn convention (trunk/branches/tags). The "problem" is that below each copy there are two totally useless directories that I'd really like to eliminate in my git repo. My svn structure looks like this:

trunk/redundantdir1/redunddantdir2/realstuff
branches/b1/redundantdir1/redunddantdir2/realstuff
tags/t1/redundantdir1/redunddantdir2/realstuff
...

In svn those two directories didn't hurt as much, because most users would just check out from "realstuff" and down. With git I'd really like to keep redundant-dirs out of the repo. I'm not prepared to start changing the svn structure, and I need to be able to keep the git repo in synch with subversion for (a short) time. Suggestions ?

+1  A: 

I don't suggest using git-svn to do any SVN branching or merging, so you really don't need the branches or tags directories. Then you can just clone the part of the repo you need like this:

git-svn clone https://example.com/svnroot/trunk/redundantdir1/redunddantdir2/realstuff myprojectname

Edit: If you do need to make changes in a branch (rather than creating or merging branches which I would suggest doing with real svn), then you can simply clone that branch as a separate git repo like so:

git-svn clone https://example.com/svnroot/branches/b1/redundantdir1/redunddantdir2/realstuff myprojectname-b1
Andy Balaam
Actually a good suggestion which may fit the bill as long as I always merge changes back to trunk in svn and fetch them into git from there. But there is at least one branch in svn that I need to get into this git repo.
krosenvold
I'd suggest using a different git repo to make changes in that branch.
Andy Balaam
I've edited the answer to suggest that.
Andy Balaam