Max Yankov
Max Yankov

Reputation: 13297

Setting up git-svn to follow a non-standard svn repo

Here's the structure of my SVN repo:

Project 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

Answers (1)

Max Yankov
Max Yankov

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

Related Questions