Migrate Git to TFS with all history

ehsandotnet picture ehsandotnet · Dec 24, 2013 · Viewed 18.7k times · Source

Is there any way to migrate a git repository to TFS with all it's history like versions, branches and push messages? Now the source is on Github and I want to migrate that to my local TFS repository.

Answer

mzagozda picture mzagozda · Jan 2, 2015

Install git-tf from Codeplex source, MS Downloads, or better yet:

Then run the following commands:

  1. First you need to configure your GIT repository

    git tf configure http://yourserver.com:8080/tfs/DefaultCollection $/RepositoryName
    
  2. Check in the files, optionally persisting author/USERMAP:

    git tf checkin --deep --autosquash --keep-author
    

This process is very slow, but it works, so ensure you have plenty of time to spend migrating. The only downside is that commit time will be the current checkin time, not the original changeset time.