Migrate from TFS to Github Source control

Before migration make sure you have installed Github client, Java development kit. You can download JDK from https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/ . Make sure your JAVA_HOME is also set under environment variables

Please follow the step by step guide mentioned below:

  1. Download GIT-TF from the following URL git-tf.zip
  2. Extract the download file and navigate to the extracted folder. eg: C:\git-tf
  3. Now we need to extract the TFS project and history, thereafter clone the project for GitHub 
    • Open the command prompt and navigate to C:\git-tf
    • Extract project and history from TFS and clone for GitHub by using the following syntax

      git-tf clone <TFS Project Collection> <TFS Project Name> <Output Source> --deep
      eg: git-tf clone 
      http://tfs.comapanyname.com:8080/tfs/DefaultCollection $/Project/ C:\ProjectDirectory --deep
    • Once you execute the above command, it will prompt you to enter TFS username and password. 
    • After entering your TFS credentials, GIT-TF will extract the history from TFS and make a clone for GitHub. This step may take time depending upon the history size. 
  4. Create a new repository in Github
  5. Add the cloned project to the remote GitHub
    • Open the command prompt and navigate output source folder eg: C:\MyEFFramework and execute the following command to create a remote link with GitHub
      C:\ProjectDirectory>git remote add origin https://github.com/reponame
  6. Verify the GitHub remote configuration
    • In the output source folder execute the following command to verify the remote link configuration is correct
      C:\ProjectDirectory>git remote -v
    • If the configuration is correct, we will get the following output with the remote GitHub link
      origin https://github.com/reponame (fetch)
      origin https://github.com/reponame (push)
  7. Push the source to the GitHub repo
    • In the output source folder execute the following command to push the source to GitHub repo, this may take time, based upon the size of the project
      C:\ProjectDirectory>git push -u origin master
  8. That’s it, you successfully moved the TFS project with history to GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *