1

Here's the structure of my SVN repo:

  • http://server.net:8080/svn/CompanyName — svn root
  • http://server.net:8080/svn/CompanyName/ProjectBranch3 — current branch of the project
  • http://server.net:8080/svn/CompanyName/ProjectBranch2 — previous branch of the project
  • http://server.net:8080/svn/CompanyName/ProjectBranch1 — first branch of the project
  • http://server.net:8080/svn/CompanyName/SomeRandomProject — another project in the same root that I don't want to check out. There are lot of them
  • http://server.net:8080/svn/CompanyName/Tags/ProjectName/ — tags for the project

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?

1
  • Please don't mark this question as duplicate of this: stackoverflow.com/questions/572893/… this question is about a situation where all svn branches were contained in a single branch directory, every subdirectory of which is a branch. This is not the case here. Commented May 11, 2015 at 8:27

1 Answer 1

1

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/*
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.