Friday, September 30, 2011

Migrating from Git to Svn and Svn to Git

The following steps will migrate to and from GIT while maintaining all commit history.

svn2git# First, create a new GIT Repo
# Then, do the following
git svn init <svnUrl>/<svnRepoName>
cd <svnRepoName>
git svn fetch
git svn rebase
git remote add new <user>@<gitRepo>
git push new master

git2svn# First, create a new SVN Repo (with at least 1 file in it)
# Then, do the following
git svn clone <svnUrl>/<svnRepoName>
cd <svnRepoName>
git remote add old <gitRepo>
git fetch old
git checkout -b old_master old/master
git rebase --onto master --root
git svn dcommit

No comments:

Post a Comment