Search code examples
gitsvngit-svngit-clone

How do I use git svn to clone more than one branch, but not all?


Cloning an entire svn repo is simple: git svn clone svn://somesvnrepo --std-layout (or use --branches=/branches).

Cloning a single branch is also simple, git svn clone svn://somesvnrepo/branches/mybranch

But how can I git svn clone multiple specific branches? Say I wanted to grab /branches/red, /branches/green and /branches/blue.


Solution

  • Try following command and add all branches where you want to clone:

    git svn clone -s --prefix=svn/ -b branches -b branches/red -b branches/green -b branches/blue