0

The structure of the SVN configuration is as follows.

https://hogehoge/svn/
    trunk/
        hoge/
            release01/
            release02/
    tags/
        hoge/
    branches/
        project1/src
        project2/src

Now, I would like to migrate branch/project1/ and branches/project2/ with git-svn. I want it to be like this in local repo.

c:Sample/sampleForGit
    branches/
        project1/src
        project2/src

I have edited config as follows, but it does not work.

[svn-remote "svn"]
    url = https://hogehoge/svn/
    fetch = branches/project1:refs/remotes/git-svn/branches/project1
    fetch = branches/project2:refs/remotes/git-svn/branches/project2
    branches = branches/project1/*:refs/remotes/git-svn/branches/project1/*
    branches = branches/project2/*:refs/remotes/git-svn/branches/project2/*

The branches of project1 and project2 are not separated.

c:Sample/sampleForGit
    branches/
        src

How can I import separate branches?

  • It's a long time since I did this last time but I _think_ you either keep the 2 `fetch` lines you have (they look correct to me) and remove the 2 `branches` or you remove the 2 `fetch` and keep a single `branches` line like this: `branches = branches/*:refs/remotes/git-svn/branches/*`. In other words, `fetch` specifies paths to branches (they look correct the way you put them there, I think) and `branches` points to a directory that _has_ a branch **per subdirectory**. – eftshift0 Jan 24 '23 at 15:45
  • I removed the 2 branches line and tried only the 2fetch line, but that didn't work. I will try to removing 2 fetch line like this [branches = branches/project1/*:refs/remotes/git-svn/branches/project1/* branches = branches/project2/*:refs/remotes/git-svn/branches/project2/*]. There are really a lot of branches, so doing it this way would take an enormous amount of time, and I don't really want to do it.[branches = branches/*:refs/remotes/git-svn/branches/*] – kagecafe Jan 25 '23 at 23:40

0 Answers0