TFS Version Control to git

TFVC you say. Yes Team Foundation Version Control or the terminal case of Visual Source Safe that Microsoft realized was battle no longer worth fighting git with and was one of many reasons to buy GitHub.

Well had to dig out old code that was buried in this old system and used the git-tfs tool to export the history to a git repository so others will not have to fight with this system anymore.

Process

  • Find the root tfs path for example http://internal-url:port/tfs/CORP
  • Then find the corresponding repository base in this case it was $/Software
  • Identify all the repositories under this url for example Database, Services, UI

Put it all together like so and make sure to use the --resumable option because TFS is slow compared to git and could choke and fail on exporting the entire history. From the above it would look like this

git-tfs clone --resumable http://internal-url:port/tfs/CORP $/Software/Database <target base>/src/Database
git-tfs clone --resumable http://internal-url:port/tfs/CORP $/Software/Services <target base>/src/Services
git-tfs clone --resumable http://internal-url:port/tfs/CORP $/Software/UI <target base>/src/UI

Now you should do some cleanup because branches from the TFS system will be folder instead of git branches, but once that is done it is a good starting point for a useable git repository.