web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Migrating from TFVC to Git in Azure DevOps Full History: A Step-by-Step Guide

Posted on by 2
Migrating from TFVC to Git in Azure DevOps Full History: A Step-by-Step Guide

If your organization is modernizing its Dynamics 365 development, you're likely moving from hosted LCS DevBoxes to a Unified Development Environment (UDE). This shift is the perfect opportunity to leave another legacy system behind: TFVC (Team Foundation Version Control). By default using UI You can migrate History upto 180 days only. If you need full history then you have to use GITFS tool.
Why Migrate from TFVC to Git?
  • TFVC is legacy: It’s centralized, harder to manage in distributed teams, and lacks modern branching workflows.
  • Git is the future: It supports distributed development, better CI/CD integration, and is the default for Azure DevOps and GitHub.
  • UDE compatibility: Git repositories are easier to integrate with UDE pipelines and automation tools.
Step 1: Prepare Your Azure DevOps Environment
First, create a new, empty Git repository within your existing Azure DevOps project. We named ours D365_GIT.


Step 2: Set Up Your Migration Toolkit
To perform the migration, we need a couple of key tools.
  • Install Git Credential Manager: This handles authentication with Azure DevOps seamlessly. You can download it from the official Microsoft site.
  • Download Git-TFS: This is the magic tool that bridges TFVC and Git. Download the latest release (we used v0.34.0) from the Git-TFS GitHub page. Extract the ZIP file to a convenient folder, like C:\Users\<YourUsername>\Downloads\GitTfs-0.34.0\.
Step 3: Configure Authentication
Open PowerShell as an administrator, navigate to your Git-Tfs directory, and run the following command to set up OAuth authentication. Using a Collection Admin account here helps avoid permission issues.
                git config --global credential.azreposCredentialType oauth
Step 4: Export Your TFVC History
Now for the main event: pulling the history from TFVC. The git-tfs clone command with the --export flag is our key here.
Navigate to your Git-Tfs directory in PowerShell and run a command like this:
.\git-tfs clone "https://dev.azure.com/MydevopsOrgName" "$/MyprojectName/Trunk" "C:\GitMigration\MyprojectName\Trunk" –export
A quick note: While you can clone the entire trunk, we found it more manageable to migrate specific branches or folders. This command targets our QA folder specifically.



It will take time as per current repos size and end up with below screen

Verify your code and data is exported in local folder.

Step 5: Connect and Push to Your New Git Repository
Once the export is complete, navigate to the newly created local repository.
                cd C:\GitMigration\MyProject\trunk\QA Or Just trunk depend on your Repos structure

Now, we need to tell this local repository where its new home on Azure DevOps will be. The git remote add command sets this up.
                git remote add origin https://dev.azure.com/myOrg/MyProject/_git/D365_GIT

What this does: Think of this as setting a "remote home address" for your local code. The name origin is a standard alias for your main remote repository.
(If you get an error that the remote 'origin' already exists, you can remove it with git remote remove origin and then run the add command again.)

Step 6: Upload Your Code and History to GIT Devops repository
This is the final push! We’re going to take our local master branch (which contains the exported TFVC history) and push it to a specific branch in the new Git repo. We want our QA code to live in a branch called trunk/QA.
git push origin master:refs/heads/trunk/QA

You're Done!
Open your Azure DevOps repository in the browser. You should now see your code safely stored in the new trunk/QA branch, with the full commit history intact.
Open Devops URL in browser and check if your code is uploaded with full history.
Categories:

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 271

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 102 User Group Leader

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 83

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans