---
title: How easy it’s to migrate SVN to TFS 2013 (Git Repo)
description: How easy it’s to migrate SVN to TFS 2013 (Git Repo)
---

[InCycle Software's Application Modernization and DevOps Blog ](https://blogs.incyclesoftware.com)

# [How easy it’s to migrate SVN to TFS 2013 (Git Repo)](https://blogs.incyclesoftware.com/2013/08/how-easy-its-to-migrate-svn-to-tfs-2013-git-repo/)

 Written by [Sahas Subramanian](https://blogs.incyclesoftware.com/author/sahas-subramanian) | Aug 8, 2013 2:24:07 AM

If you wonder what's happening with Git & TFS combination, spend a few minutes here

[http://incycle-corpweb.azurewebsites.net/2013/08/git-in-visual-studio-alm-world/](http://incycle-corpweb.azurewebsites.net/2013/08/git-in-visual-studio-alm-world/)

[http://incycle-corpweb.azurewebsites.net/2013/08/version-control-with-tfs-2013-git-repository/](http://incycle-corpweb.azurewebsites.net/2013/08/version-control-with-tfs-2013-git-repository/)

In VS 2013, we have the ability to create Team Projects with Git repo to version control the code..here is a quick walkthrough showing how to migrate your code from SVN to TFS (Git Repo)

Why did I choose SVN – [TFS Integration Platform](https://blogs.incyclesoftware.com/2013/08/how-easy-its-to-migrate-svn-to-tfs-2013-git-repo/tfsintegration.codeplex.com) does a pretty good job to migrate sources and work items from Clear Case and Clear Quest respectively. However, they didn't invest enough to expand that initiative and specifically, we see the willingness to move from SVN and unfortunately there is no easy way. There are some 3rd party tools but you got to pay J. But Git Repo makes it much easier. I know SVN à Git migration or Local Git repos with SVN centralized repo is not something new but gets more importance as Git joins VS ALM family.

So, I take one of the open source repository teach-me from google code [http://teach-me.googlecode.com/svn](http://teach-me.googlecode.com/svn). This is fairly small Repo has about 270 changes between 2009 and today.

On my laptop, I got Git installed with Git bash.

**Initialize new Git Repo  
**

 

I created a local folder called teach-me and currently on that path.

I'm using git svn to the most part

Command:

git svn init http://teach-me.googlecode.com/svn/trunk/ --no-metadata

Output:

Initialized empty Git repository in c:/Users/Sahaswaranamam/Source/Repos/teach-me/.git/

**Fetch SVN Repo  
**

 

Run the below command to fetch the repository.

Command:

git svn fetch

Output:

 

Above, I want to fetch all the revisions from SVN.

If you want to fetch portion of the code, you might use below command (change the revision accordingly)

git svn fetch –r revision:HEAD

Once this process is over, if you run git log, you should see all the commits in local Git

 

**Create TFS Team Project with Git Repo  
**

 

Now, Git repository is available in my local disk with all the history data from SVN.

On the right side, I want to create a new TFS Team Project with Git as the centralized repository

(Though, I'm using TFSService, you should be able to create the same from TFS 2013 PRev)

 

**Git Remote  
**

Now, we have another centralized Git repository ready and inorder to push/pull code between these repositories, we just need to add the alias

Command:

git remote add TfsGit [https://sahas.visualstudio.com/DefaultCollection/_git/teach-me](https://sahas.visualstudio.com/DefaultCollection/_git/teach-me)

 

**Push the code to centralized Git Repo  
**

 

Now, we are ready to push the code from local Git repository to Remote Git repository and hence all the team members can consume from the centralized Git repository

Command:

git push TfsGit master

Output:

*$ git push TfsGit master  
*

Username for 'https://sahas.visualstudio.com': sahas

Password for 'https://sahas@sahas.visualstudio.com':

Counting objects: 3424, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (3407/3407), done.

Writing objects: 100% (3424/3424), 3.65 MiB | 527.00 KiB/s, done.

Total 3424 (delta 2751), reused 0 (delta 0)

remote: Analyzing objects (3424/3424) (8066 ms)

remote: Storing pack file and index... done (626 ms)

To https://sahas.visualstudio.com/DefaultCollection/teach-me/_git/master

* [new branch] master -> master

**We are done..navigate to TFS web access and look at the history on the server repository  
**

 

**  
**

 

**  
**

 

 

 

 

 

 

 

 

 

On a normal laptop this entire process took about 20 mins..

Thanks for reading and stay tuned to see how to migrate SVN-->TFS Version Control

[View full post](https://blogs.incyclesoftware.com/2013/08/how-easy-its-to-migrate-svn-to-tfs-2013-git-repo/)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Sahas Subramanian"
  },
  "dateModified" : "2017-07-20T16:38:30.891Z",
  "datePublished" : "2013-08-08T02:24:07Z",
  "headline" : "How easy it’s to migrate SVN to TFS 2013 (Git Repo)",
  "image" : {
    "@type" : "ImageObject",
    "height" : 375,
    "url" : "http://cdn2.hubspot.net/hub/707613/file-3322895517-png/blog-files/080813_0623_howeasyitst1.png",
    "width" : 660
  },
  "mainEntityOfPage" : "https://blogs.incyclesoftware.com/2013/08/how-easy-its-to-migrate-svn-to-tfs-2013-git-repo/",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://cdn2.hubspot.net/hubfs/707613/logo-InCycle-New-Blue---transparent.png",
      "width" : 195.91837
    },
    "name" : "InCycle Software Blog"
  }
}
```