Canarys | IT Services

Blogs

Migration Process of SVN to Git

Date:
Author:
Tags:
Share

Subversion (SVN) is a central version control system (VCS) while Git is a distributed version control system. SVN does some things very well and has been a great source control system. But the features that Git brings – distribution, performance, easy branches, easy merges, stash – are hard to pass up. These two tools have some big differences, but git has more advantage than svn, which is why a lot of companies are now migrating from svn to git. There are several ways to do migration process but now, in this document, we’ll just see the migration process through Git Native commands.

The prerequisites for the svn to git migration process are as follows and we must ensure that the tools below are installed before the migration process begins.

  1. Git Bash
  2. Git – SVN Tool

Git includes an incredibly useful tool, ‘git-svn’ which is a bidirectional connection between Git and SVN. It allows you to pull, and if you so desire push, commits to and from SVN. We recommend avoiding pushing back to SVN because, well, why would you? We’re here to switch, not combine! We’ll just use it to pull down all commit history, branches and tags from SVN.

In a nutshell, git-svn is a git command that allows using git to interact with Subversion repositories. git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation.

 

SVN to Git Migration using Windows PC:

The general workflow for this process is:

  1. Firstly, create a local folder in Windows PC.
  2. Initialize a Git repository with the SVN repository.
  3. Fetch from the SVN repository.
  4. Add the Git remote repository.
  5. Finally, Push everything to Git remote repository on the Git host.

Step 1: To start, create a local folder in Windows PC.

3

Step 2: Now, switch to created repository and initialize a git repository with the svn repository.

4

Step 3: Fetch from the SVN repository and saving it in local folder.

5

Step 4: Adding the Git remote repository.

6

Step 5: Finally, Pushing the data from local repository to Git remote repository.

7

SVN to Git Migration using Linux PC:

The general workflow for this process is:

  1. Open Putty.
  2. Login into Linux machine by providing credentials.
  3. Next, Create a directory i.e. > mkdir “Directory Name”
  4. Change the path from root to created directory path i.e. > cd “Directory Name”
  5. Initialize a Git repository with the SVN repository.
  6. Fetch from the SVN repository.
  7. Add the Git remote repository.
  8. Finally, Push everything to Git Repository on the Git host.

Step 1: Open Putty.

1

Step 2: Login into Linux machine by providing credentials.

2

Step 3: Next, Create a directory i.e. > mkdir “Directory Name”

8

Step 4: Change the path from root to created directory path i.e. > cd “Directory Name”

9

Step 5: Now, initialize a git repository with the svn repository.

10

Step 6: Fetch from the SVN repository and saving it in local folder.

11

Step 7: Adding the Git remote repository.

12

Step 8: Finally, Pushing the data from local repository to Git remote repository.

13

That’s it. We have migrated SVN repository to Git using Git native commands. You should now have a functioning Git repository with all your commits, branches and tags from SVN migrated to Git.

Leave a Reply

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

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.