Reputation: 13297
Here's the structure of my SVN repo:
http://server.net:8080/svn/CompanyName
— svn roothttp://server.net:8080/svn/CompanyName/ProjectBranch3
— current branch of the projecthttp://server.net:8080/svn/CompanyName/ProjectBranch2
— previous branch of the projecthttp://server.net:8080/svn/CompanyName/ProjectBranch1
— first branch of the projecthttp://server.net:8080/svn/CompanyName/SomeRandomProject
— another project in the same root that I don't want to check out. There are lot of themhttp://server.net:8080/svn/CompanyName/Tags/ProjectName/
— tags for the projectProject was developed as ProjectBranch1
at first, then copied into ProjectBranch2
, and ProjectBranch3
in the end. I want to fetch the project with all of it's history, and I want git to understand that each branch started where previous one finished.
Now, the git init
command has a -b
option to specify a subfolder that is used for branches. However, the svn branches are not contained to a subfolder; as described above, they are located right in the root as individual sub-directories.
How can I configure git-svn
to achieve this?
Upvotes: 1
Views: 27
Reputation: 13297
I was able to do it with the following .git/config
file:
[svn-remote "svn"]
url = http://server.net:8080/svn/CompanyName
fetch = ProjectBranch3:refs/remotes/origin/trunk
branches = {ProjectBranch1, ProjectBranch2}:refs/remotes/origin/bracnhes/*
Upvotes: 1