Thursday, 27 December 2018

GIT: Migrating from SVN

To convert Subversion projects to Git you can use a RubyGem called svn2git. This tool relies on git svn internally and handles most of the trouble.
To install it (on Ubuntu) simply type:
sudo apt-get install git-svn ruby rubygems

sudo gem install svn2git
Let’s say you have a repository called
http://svn.example.com/repo
with the default layout (trunk, branches, tags) and already prepared a local git repository where you want to put everything. Then navigate to your git directory and use the following commands:
svn2git http://svn.example.com/repo --verbose

svn2git --rebase
The parameter --verbose adds detailed output to the commandline so you can see what is going on including potential errors. The second svn2git --rebase command aligns your new git repository with the svn import. You are now ready to push to the web and get forked! If your svn layout deviates from the standard or other problems occur, seek svn2git --help for documentation on additional parameters.

0 comments:

Post a Comment