Microsoft acquired GitHub, and every one have unlimited private repository. This reason alone make me want to move all my project and source code to GitHub.

A bit of history

In around 2012, developers don’t have much choices in where to store their code for free. Sure you can use GitHub, but it limit the number of private repository and number of collaborators. The obvious choice at that time was Visual Studio Online, or today Azure DevOps. The only source control system it’s provided is Team Foundation Server (TFS).

Today, 9.99 over 10 developers will choose git over tfs, and we need a way to migrate from TFS, with history, to git.

Required tools

Alternatively, you can install git-tf with Chocolatey:

choco install gittfs

Migration steps

Clone the TFS project

git-tfs clone https://your_organization.visualstudio.com/ $/your_project_name

If your project name contain whitespace, just put the whole name in quote mark

git-tfs clone https://your_organization.visualstudio.com/ "$/your project name"

This will clone the project to the folder you run the command

Add .gitignore

Now the project is like any other git project, with a .git folder. You should add a .gitignore file to prevent commit unwanted files.

A sample .gitinore file here: Visual Studio Git Ignore

Push code

The final step is to push code to your favorite git service.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.