Well, it turns out somebody (probably named dmo?) did all the hard work: Multiple branches using git-svn

If you’re like me, you need to track multiple branches in the same Git repository. I’m going to use this extensively in the XLsuite repository. I have 2 trunks/mainlines: one for the closed source, and one for the open sourced version, I also have a stable version, and some work in progress branches.

2 Responses to “How to handle multiple branches from Subversion using Git”

  1. Cristi Balan Says:

    His website doesn’t allow comments so I’ll add this here :)

    There’s a simpler way do add those svn remotes without manually editing .git/config. You can find these in man git-svn under Advanced Options.

    git svn init -R git_svn_remote_name --id=git_svn_refname svn://blah
    git svn fetch -r XXX git_svn_remote_name

    I’m using this approach in braid and it works great.

  2. bartman Says:

    Hi,

    while Dave was correct about his solution; it used to be the only way. With git 1.5.3 you can do better.

    Here is how I track one of the projects in git:

    1. cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true
    [svn-remote "svn"]
      url = svn://nex.scrapping.cc/shell-fm
      fetch = trunk:refs/remotes/trunk
          branches = branches/*
          tags = tags/:refs/remotes/tags/*

    It now becomes really easy to work with multiple branches in svn, they are just branches in git.

    1. git branch -r branches/1.2 branches/autoconf branches/plugins branches/ripperbahn tags/0.1.3 tags/0.2 trunk

    -Bart

Leave a Reply

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(4) (1) (1) (1) (1) (2) (1) (1) (1) (2) (2) (1) (2) (1) (3) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (4) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (1) (3) (1) (5) (2) (10) (10) (11) (14) (2) (1) (3) (1) (1) (1) (1) (1) (0) (1) (2) (2) (2) (1) (1) (1) (4) (1) (3) (1) (4) (2) (2) (25) (2) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (1) (4) (5) (1) (1) (1) (4) (1) (2) (3) (4) (4) (1) (1) (1) (8) (3) (1) (5) (5) (2) (2) (2) (4) (8) (7) (1) (1) (1) (1) (2) (4) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives