Categories
Tech

Convert Subversion Repo to Git

Create a local empty SVN repo.

svnadmin create /path/to/repo

In the newly created repo cd into hooks/ and create new file named pre-revprop-change and enter the following.

#!/bin/bash

Remember to make the newly created file executable.

chmod +x hooks/pre-revprop-change

Initialise the local repo to point to the SVN.

svnsync init file:///path/to/local/repo https://path/to/online/repo/svn

Sync the two together.

svnsync sync file:///path/to/local/repo

Import the local SVN repo to a newly created Git repo.

git svn clone file:///path/to/local/repo projectname

Create a new Git –bare remote repo and add a remote link to the local repo.

git remote add origin https://githost.com/project.git

Push the local repo to the remote.

git push origin master

Bish bosh job done! Your now free of the tiresome Subversion 😀

Leave a Reply

Your email address will not be published. Required fields are marked *