Migrating from TFVC to Git

Migrating from TFVC to Git

TFVC is a centralized version control system allowing teams to store any type of artifact within its repository. TFVC is part of Team Foundation Server, or commonly known as TFS. TFS is a Microsoft product that provides source code management, reporting, requirements management, project management, automated builds, lab management, testing and release management capabilities. While TFVC has received its part of rants and even concerns whether Microsoft is abandoning TFVC altogether, it's still live and kicking.

Deveo does not support TFVC, nor we have any plans on supporting it as we already support Git, Subversion, and Mercurial. However, we have been asked from time to time, how would one switch from using TFVC to Deveo. Typically we have suggested Git as a good alternative for TFVC. In this blog post, I'm going to describe step by step guide to migrate a TFVC repository to Git repository.

1. Create new project and Git repository to Deveo

The first thing we need to do is to setup a new Git repository. In Deveo, you can have multiple repositories within a project. Creating a new project and the needed repository takes a couple of clicks. The ease of creation has been described in a separate blog post.

2. Install and setup Git-TF

Even though Creating a project and a Git repository in Deveo doesn't require technical skills, in this step, we will need to do some command line magic. In this post, we use Git-TF, which is a set of cross-platform, command line tools that facilitate sharing of changes between TFVC and Git.

Git-TF Binaries can be downloaded from Microsoft Download center. In order to use Git-TF, you need to have the path where you extracted Git-TF as well as java executable in your PATH environment variable. Alternatively, you can use Chocolatey and simply type cinst Git-TF to install and setup Git-TF.

3. Clone the TFVC repository to your local machine

Cloning the TFVC repository to your local machine is done using Git-TF with the following command:

git-tf clone http://myserver:8080/tfs/mycollection $/TeamProjectA --deep  

where myserver:8080points to your TFS server and port it's running, and TeamProjectA to your TFS project. The --deep flag is used to clone each TFS changeset for the specified path into the new Git repo.

4. Pushing the changes to your Git repository

After you have successfully cloned the TFVC repository into a Git repository using Git-TF, you need to add the Deveo Git clone URL as a remote to the repository. You may add a new remote using the following command:

git remote add deveo https://DEVEOUSERNAME@app.deveo.com/COMPANY/projects/PROJECTNAME/repositories/git/GITREPO  

The URL to the Git repository in Deveo can be found from Deveo repository view.

Deveo repositories view and the Git clone URL

After adding the remote, you may use git push deveo to push the changes to the Git repository.

Conclusion

With the steps listed above migrating from TFVC to Git is an easy and fast task to do. The downside of the above approach is that the branches are migrated as directories. There is an open source solution Called Git-TFS, which supports some TFVC branching strategies. This might be worth checking out if you use TFVC branching and wish to retain the history.

Seamless software development.

Code management and collaboration platform with Git, Subversion, and Mercurial.

Sign up for free
comments powered by Disqus