0

How can I import a specific branch in my SVN repo to another existing GIT repo? ex. svn/my-branch --> git/my-branch

Kulvis
  • 655
  • 11
  • 33

1 Answers1

0

Yes, by doing something like (see: here for more details):

  1. Define the new branch in .git/config :

    [svn-remote "release-branch"]
       url = svn+ssh://user@example.com/source/branches/branch_name
       fetch = :refs/remotes/git-svn-release-branch
    
  2. Import the SVN branch. SVN_BRANCHED_REVISION is the the revision when the branch happened in SVN.

    git svn fetch release-branch -r SVN_BRANCHED_REVISION
    

In order to establish the SVN_BRANCHED_REVISION value you can use:

  svn log --stop-on-copy PATH_TO_BRANCH
  1. Hook up a local Git branch to the remote branch:

    git branch --track release git-svn-release
    
  2. Checkout and update

    git checkout release
    git svn rebase
    
dan
  • 13,132
  • 3
  • 38
  • 49