/ TFS

Moving from TFVC to Git on VSTS

I've got a task this week to move a fairly old project from an internal TFS instance (using TFVC) to Visual Studio Team Services using Git.

1st Attempt

I tried using the steps from this link (import-from-tfvc), but then I realized half way through that my project wasn't in VSTS. So no good.

2nd Attempt

I started following the steps on https://www.visualstudio.com/learn/migrate-other-systems-to-git/, but pretty early I realized that it wouldn't keep any history then what would be the point?

3rd Attempt - Success

I've found this post from Juri Strumpflohner with steps using Git-TF to do the job.

I had only one issue while trying to run the command git-tf which was "Git-tf unable to find required JAR" where I quickly fixed by following an answer in this post.

Other than that happy days with these steps:

  1. Create Team Project on VSTS using Git
  2. Install Git-TF
  1. Back to console
//Clone TFS repository. This will take a few hours depending on the size of the repository
git-tf clone http://yourtfsserver:8080/tfs/colletionname $/TeamProjectA/Main --deep
//Navigate to the just created folder
cd TeamProjectA/Main
//Add new remote repository
git remote add origin https://example.visualstudio.com/DefaultCollection/_git/TeamProjectA
//Push all
git push -u origin --all
  1. 😎
Other options

If keeping the work items as well as code history is your requirement then you might want to check the video below from Danijel Malik and Adam Cogan entitled Migrating from TFS to the Cloud... Without Losing Your Mind and also Rules to Better TFS Migration to the Cloud

**Video: Migrating from TFS to the Cloud... Without Losing Your Mind**

Hope it helps. It will definitely help me in the future if I need to do it again.

Cheers.

Buy me a coffeeBuy me a coffee
Thiago Passos

Thiago Passos

I'm Thiago Passos, a Solution Architect working for SSW sharing what I've been working with and learning. Love technology, dancing and I get unfriendly when I'm hungry.

Read More