Azure Devops Tfs To Git

Azure Devops Tfs To Git

Reading time1 min
#DevOps#Migration#VersionControl#AzureDevOps#Git#TFVC

Seamless Migration from TFS to Git in Azure DevOps: Mastering the Transition Without Disruptions

Forget the myth that migrating from Team Foundation Server (TFS) to Git is a mere lift-and-shift operation; this post will reveal why treating it as a strategic transformation—not just a technical move—can unlock the full power of Git workflows and set your team up for future success.

Transitioning from TFS (now often referred to as Azure DevOps Server when on-premises) to Git in Azure DevOps Services is more than just swapping one version control system for another. It’s a pivotal step towards modernizing your development workflows, fostering better collaboration, and harnessing the power of distributed version control. But many teams underestimate the complexity and potential risks of this move — ranging from downtime and lost history to adoption resistance.

In this post, I’ll walk you through a practical, step-by-step migration strategy to ensure your transition is smooth, efficient, and disruption-free.


Why Move from TFS Version Control to Git?

TFS primarily uses centralized version control (TFVC - Team Foundation Version Control). Although TFVC has been reliable for years, Git offers several advantages:

  • Distributed nature: Every developer has a full copy of the repository history locally.
  • Advanced branching and merging: Encourages feature branch workflows, enabling parallel development without bottlenecks.
  • Broad ecosystem: Integration with countless tools and established workflows like GitFlow.
  • Cloud readiness: Azure DevOps Services is optimized for Git repositories.
  • Better collaboration: Pull requests, code reviews, and built-in CI/CD integrations elevate team efficiency.

Recognizing these benefits early helps frame your migration as transformational rather than transactional.


Pre-Migration Checklist: Preparing for a Smooth Transition

Before diving into migration commands and processes, preparation is key.

  1. Audit Your Current TFVC Repository

    • Understand your branching structure.
    • Identify large binary files or folder sizes.
    • Review sensitive data or secrets that should not migrate.
  2. Engage Your Development Team Early

    • Communicate reasons for change.
    • Provide initial training on Git basics.
    • Gather concerns to address later with hands-on sessions.
  3. Set Up Your Target Azure DevOps Project & Repository

    • Create a new Git repository (or multiple if required).
    • Consider if you want monolithic vs multiple repos based on your team's needs.
  4. Backup Everything

    • Take snapshots or database backups of existing TFS data.
    • Export work items if you want them preserved outside version control.
  5. Decide What to Migrate

    • Full commit history?
    • Only main branches?
    • Tags?

The more thoughtful your prep, the less messy the migration will be.


Step-by-Step: Migrating From TFS (TFVC) to Git in Azure DevOps

Step 1: Install Microsoft’s git-tfs Tool

git-tfs bridges TFVC repositories into Git by cloning history and preserving changesets.

Install via Chocolatey (Windows):

choco install gittfs

Or get binaries here:

https://github.com/git-tfs/git-tfs


Step 2: Clone TFVC Repository Using git-tfs

From your command line:

git tfs clone https://tfs.yourcompany.com/tfs/DefaultCollection $/Project/Path --branches=all
  • Replace URL and path accordingly.
  • --branches=all fetches all branches; omit if unnecessary.

This process imports changesets as commits into a new local Git repo while trying to preserve branch structure.

Tip: If you deal with very large repos or long histories, this can take hours. Patience is key!


Step 3: Inspect and Clean Your Local Git Repo

After cloning:

  • Check commit history with git log.
  • Check branches with git branch -a.
  • Remove large or unnecessary binary files that may bloat repo size:
git filter-repo --path <file-path> --invert-paths

(You may need to install git-filter-repo separately.)

Make sure each commit message corresponds well with original TFS changesets for traceability.


Step 4: Push Local Git Repo To Azure DevOps Service

  1. Create an empty Git repository in your Azure DevOps project UI.
  2. Add the remote in your local repo:
git remote add origin https://dev.azure.com/yourorg/yourproject/_git/yourrepo
  1. Push all branches and tags:
git push origin --all
git push origin --tags

Confirm everything appears correctly in Azure Repos web UI.


Step 5: Enable Branch Policies & Workflows

One big advantage of migrating is having access to advanced branching policies such as mandatory pull requests, review gates, build validations, etc.

In Azure DevOps:

  • Configure branch protection on main or master.
  • Set mandatory reviewers for PRs.
  • Enable automatic builds on PR submission.

This encourages best practices post-migration.


Step 6: Train Your Team & Update CI/CD Pipelines

Migration success is not just technical — it’s cultural too!

Offer interactive workshops covering:

  • Basic Git concepts & commands (clone, branch, merge, rebase, pull, etc.)
  • New branching model aligned with the team’s workflow (GitFlow? trunk-based?)
  • Managing pull requests instead of direct check-ins

Update pipelines/tools that referenced TFVC paths so they work seamlessly with Git repos inside Azure Pipelines or external tools like Jenkins.


Troubleshooting Common Migration Challenges

IssueSolution
Large repository clone timesUse shallow clones or migrate only recent history segments
Lost commit metadataEnsure all user mappings are configured in git-tfs config
Confusing file renames/historyUse --with-originate option during clone
Broken pipeline triggersUpdate YAML pipeline definitions referencing old paths
Resistance from developersProvide ongoing training & highlight productivity gains

Final Thoughts: Make it a Strategic Transformation

Migrating from TFS (TFVC) to Git isn’t just an upgrade; it’s a fundamental shift in how the team works together. Invest time upfront planning and communicating change — then leverage Azure DevOps’ powerful integration ecosystem to supercharge software delivery speed and code quality with minimal disruption.

By following these steps and considering both technical and human factors, you’ll enjoy a seamless migration experience that sets up your team not only for today’s challenges but also tomorrow’s innovation opportunities.


Additional Resources & Links

Happy migrating!


If you’re planning your own migration or have insights from experience — I’d love to hear what worked well or unexpected hurdles you faced. Drop me a comment below!