Want to migrate a TFVC Team Project to GIT, along with history? It’s simple!
Follow the blog to get step by step procedure on how to do it.
1. You need to have GIT installed on your machine.
You can download GIT for windows at : https://git-scm.com/download/win
2. You need to have contents of git-tf. (You can set the environment variables)
Download from https://gittf.codeplex.com/
1. Create a new Team Project with GIT as version control.
In my example I am moving TEAM Project from: the team project name "Apchintfs2013 Team Project" to GIT team project named "ToGit"
2. If you haven’t set the environment variables for git-tf, navigate to the path where you have git-tf downloaded and extracted.
Open a Command Prompt and run the below command:
Git-tf clone "http://<TFS Server Name>:Port/tfs/<CollectionName> "$/TeamProjectName" –deep
–deep : Flag used to clone each TFS change-set for the specified path into the new Git repo
In my example:
Git-tf clone http://apchintfs2013:8080/tfs/DefaultCollection/ "$/ApchinTfs2013 Team Project" –deep
3. After running the clone command, you’ll have all the projects downloaded in your local machine from TFVC Team Project,
now you need to push it to the GIT repository.
Before anything is pushed ToGit team Project web access will look as below.
4. Open the GIT BASH when you would get after installing as mentioned in Step 1.
Navigate to the path where you had cloned the TFVC team project (refer above command).
As soon as you go to the repository, you’ll see a MASTER branch appear in the command prompt.
This is a que that it is a GIT repository now.
5. You need to push this to the GIT repository on TFS.
Run the below command to first add the GIT repository and then push it to TFS server.
(Here Master is the default branch which is created whenever you have a git repository)
Git remote add "http://TFSServerName>:port/tfs/Collectionname/_git/<GITRepositoryName>"
Git push origin master
In my example:
Git remote add "http://apchintfs2013:8080/tfs/DefaultCollection/_git/ToGit"
Give in the Username and Password with which you authenticate on On-Premise TFS.
(If you are using VSO account, you need to give Alternate Credentials instead)
Now, if you navigate to your GIT Team Project, you should be able to see all the projects along with the change-set history.
You now have a GIT Team Project which was migrated from TFVC Team Project!
Content created by – Aparna Chinya
Content reviewed by – Romit Gulati