Converting the SVN Repository To Git

From Net-SNMP Wiki
Revision as of 04:00, 28 June 2011 by Wes (Talk | contribs) (Narrowing to the right sub-repo)

Jump to: navigation, search

This page documents what was done to convert the Net-SNMP source code repository from SVN to Git on June 27th, 2011. It is here for historical purposes, and may help other projects that wish to do the same conversion.

svn2git

Of the various conversion choices (including 'git svn clone'), svn2git seemed like it would work the best. So this was run:

 # svn2git --authors /home/hardaker/src/snmp/git-authors -m -v file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/

(this process takes a long time but is much faster with a local repository which is a copy of the data pulled from SourceForge. It only took about 4 hours to convert compared to many more that it would have taken to run it against an online repo)

Narrowing to the right sub-repo

With SVN the various "projects" (httpd, net-snmp, ...) existed at the top level. This isn't correct for the now separated repositories that git allows for. Thus, git's filter-branch was used to narrow the results:

 # git filter-branch --subdirectory-filter net-snmp -- --all

Branch Merging Setups

In order to make it possible to follow the project's Git Branch Management strategies, the branches had to be set up to follow this paradigm. To do this, the following steps were performed. This step ensure that future merges from lower branches would only contain the newer code choices and that from a "future merges" perspective everything previous to this point would have been considered as "already merged".

 # git checkout V5-5-patches
 # git merge -s ours V5-4-patches
 # git checkout V5-6-patches
 # git merge -s ours V5-5-patches
 ...
 # git checkout master
 # git merge -s ours V5-6-patches