Reputation: 9829
I have 2 branches in SVN - trunk and release(branches from trunk). The intention is to migrate them into a SINGLE repository in GIT.
SVN(trunk)----->GIT(master)
SVN(release)---->GIT(release) - where GIT(release) has been branched from GIT(master)
Thereafter,we refresh the corresponding SVN source->GIT destination branches daily for a temporary intervening window of migration.
Is this possible?
If so,How to achieve this?
Upvotes: 0
Views: 484
Reputation: 1298
First, make a backup (or two) of your svn repository.
Then, install svn2git. On MacOS:
brew install ruby
gem install svn2git
Or on Debian:
sudo apt-get install git-core git-svn ruby
sudo gem install svn2git
Then (optionally, but recommended) list all of the authors in the svn repository:
svn log --quiet \
| grep -E "r[0-9]+ \| .+ \|" \
| cut -d'|' -f2 \
| sed 's/ //g' \
| sort \
| uniq
and create an authors.txt file to map svn authors to the accounts you want to use in git.
Run svn2git
:
mkdir new-git-repos
cd new-git-repos
svn2git path-to-svn-repos --no-minimize-url --authors path-to-authors.txt
Verify the new git repository (git log
, git tag
, git branch -a
, etc.), rename branches and tags if necessary, and optionally push the new repos to a server.
See the svn2git README.md for more recipes. Use svnadmin if you have access to the svn master repository and you need to apply more complicated rewritings of the commit history before conversion to git.
Upvotes: 2