Migrate a TFVC repository to GITin Team Foundation Server or Visual Studio Team Services
Todoay I got the task to migrate sources from an on-premise TFS instance running TFVS to GIT in a Visual Studio Team Services (VSTS) instance. I managed to migrate all the sources with full history. In this blogpost I will explain how I did that migration.
Java and GIT are comming with an installer. You can use the installer to install the tools with the default configuration.
GIT-TF needs a manual installation. You can use the following steps to install GIT-TF:
- Extract the contents of the .zip file to a folder on your machine, i.e. C:/GIT-TF
- Add the path where your extracted GIT-TF (i.e. C:/GIT-TF) to you PATH environment variable
- Add he path where java.exe is installed to the PATH environment variable.
You are now ready to use GIT-TF and do a migration from TFVC to GIT.
The migration is easy to do. There are actualy two steps to complete te migration. In the first step you need to create a local git repository of the TFVC repository with GIT-TF. The second step is pushing the local GIT repository to the GIT master (in Visual Studio Team Services or TFS).
Step 1: Creating a local GIT repository from a TFVS repository
The commands below are used to create a local GIT repository out of a TFVS repository. Please not that the execution of the “GIT-TF” command may take a while. The more changesets are checked in to TFVS, the longer the execution of this command will take.