Search code examples
gitgit-svn

How do I add new SVN remote branch to the existing git-svn repository


I have cloned SVN repository using git-svn and hand-picked some of branches. Now I need to add one more branch from SVN to Git. Can this be done? I Updated the .git/config file to add it but git svn fetch does nothing.

We have huge repository with non-standard layout and moving everything would not be great. So I am hoping to move only stuff I know we immediately need at the cost of some history loss (still keeping years of work). I am worried though that at some point patch for some historical release will be needed and we will not be able to add the missing branch from read-only SVN...


Solution

  • You are talking about an old branch, aren't you? It can be done, modify the configuration (as I think you have already done) and then you have to fetch and use -r specifying the revision where the branch was created.

    git svn fetch -r revision-where-it-was-created:HEAD
    

    That should do