Courseiva

Migrating TFVC to Git While Preserving Every Branch's History

Your team is migrating from TFVC to Git in Azure Repos. They want to preserve the history of all branches. Which migration tool should you use?

Quick Answer

git-tfs is purpose-built for TFVC-to-Git migrations that need to preserve full history — it converts TFVC changesets into Git commits and maps TFVC branches onto Git branches, carrying over branch relationships and merge history rather than flattening everything into a single import.

⚠ Common exam trap

Many candidates confuse git-tfs with git-svn, assuming both are interchangeable for any centralized-to-distributed migration, but git-tfs is TFVC-specific while git-svn is for Subversion, and Azure DevOps Migration Tools are for organizational data migration, not source control conversion.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

git-tfs tool

The git-tfs tool is specifically designed to migrate TFVC repositories to Git while preserving full branch history, including changesets, branch relationships, and merge history. It bridges the gap between TFVC and Git by converting TFVC changesets into Git commits and mapping TFVC branches to Git branches, making it the correct choice for this migration scenario.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    GitHub Importer

    Why it's wrong here

    GitHub Importer migrates repositories into GitHub, not TFVC history into Azure Repos Git; it cannot read TFVC changesets, so branch history is lost. It is tempting because it handles repository imports between Git hosts, which would be correct when moving existing Git repositories from another platform into GitHub.

  • ✗

    Azure DevOps Migration Tools

    Why it's wrong here

    Azure DevOps Migration Tools move work items, test plans and pipelines between projects; they do not convert TFVC changesets into Git commits, so branch history cannot be preserved. It is tempting because the name suggests repository migration, and it would be correct for migrating work-tracking artefacts between Azure DevOps organisations.

  • ✓

    git-tfs tool

    Why this is correct

    The git-tfs tool bridges TFVC and Git, cloning a TFVC repository into a Git repository while preserving full changeset history across all branches. This satisfies the requirement to retain branch history during migration to Azure Repos, which a plain git init or export would discard.

  • ✗

    git-svn

    Why it's wrong here

    git-svn bridges Git with Subversion repositories, reading SVN revision history; TFVC uses a different version-control model, so git-svn cannot import its changesets or branches. It is tempting because both are centralised systems, and git-svn would be correct when migrating a Subversion repository to Git.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 696 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

4 more ways this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A team is migrating from TFVC to Git. They have a large codebase with many branches. What is the recommended approach to preserve the history during migration?

medium
  • A.Copy the latest version of the code to a new Git repository and start fresh
  • B.Use the Git-TF tool to clone the TFVC repository
  • ✓ C.Use the git-tfs tool to clone the TFVC repository with changesets
  • D.Export TFVC as a Git bundle and import with --no-metadata

Why C: Git-tfs is a specialized bridge tool that converts TFVC changesets into Git commits, preserving the full history, author information, and branch structure during migration. Unlike Git-TF, which is deprecated and lacks support for newer TFVC features, git-tfs handles complex scenarios like merges and shelvesets, making it the recommended approach for preserving history when moving from TFVC to Git.

Variation 2. A team is migrating from TFVC to Git in Azure Repos. They have a large repository with a history of 10,000+ commits. They want to preserve the full history while minimizing migration time. Which approach should they recommend?

medium
  • ✓ A.Use git-tfs to clone the TFVC repository with full history, then push to Azure Repos.
  • B.Check out the latest version from TFVC, initialize a new Git repo, and push.
  • C.Use the Azure Repos import repository feature to import from TFVC.
  • D.Clone the TFVC repository using Git and push to Azure Repos.

Why A: Git-tfs is a specialized bridge tool that can clone a TFVC repository with full history into a local Git repository, preserving all commits, branches, and metadata. This approach minimizes migration time by performing the conversion locally without network overhead, after which the Git repo can be pushed to Azure Repos. Other methods either lose history or are not supported for TFVC-to-Git migration.

Variation 3. Your team is migrating from TFVC to Git in Azure Repos. Which TWO actions should you take to ensure a smooth migration?

medium
  • A.Use the Azure DevOps Migration Tool to directly map TFVC permissions to Git repository permissions.
  • ✓ B.Use the git-tfs tool to clone the TFVC repository with full history into a local Git repository.
  • C.Create a single Git repository with multiple branches that mirror the TFVC branch structure.
  • ✓ D.Train the development team on Git branching strategies and commands before the migration.
  • E.Enable Git LFS in the new repository to handle large binary files from TFVC.

Why B: Option B is correct because git-tfs is the standard bridge tool that clones a TFVC repository (including changesets and history) into a local Git repository, which can then be pushed to Azure Repos as the migration mechanism. Option D is correct because migrating from TFVC to Git changes the workflow fundamentally—developers must understand Git branching (e.g., topic branches, pull requests) and commands (clone, commit, push, rebase) before cutover to avoid disruption and lost work. Option A is not correct because there is no Azure DevOps Migration Tool that directly maps TFVC permissions to Git permissions; permissions must be reconfigured manually or via APIs/CLI. Option C is not correct because mirroring TFVC branch structure into a single Git repository with multiple branches is not a required or recommended migration action—Git branches are lightweight and the mapping is handled by the conversion tool, not by manually creating branches. Option E is not correct because Git LFS is optional for handling large binaries and is not a prerequisite for a smooth TFVC-to-Git migration.

Variation 4. Your team is migrating from TFVC to Git in Azure Repos. You need to preserve the full history of the TFVC repository, including all branches and changesets. The TFVC repository is large (over 10 GB). Which tool should you use to perform the migration?

easy
  • A.Manually recreate the commits in a new Git repository.
  • ✓ B.Use git-tfs to clone the TFVC repository and then push to Azure Repos.
  • C.Use git-svn to convert TFVC to Git.
  • D.Use the Azure DevOps Migration Tools to export TFVC to Git.

Why B: B is correct because git-tfs is specifically designed to bridge TFVC and Git, allowing you to clone a TFVC repository (including all branches, changesets, and history) into a local Git repository, which can then be pushed to Azure Repos. It handles large repositories (over 10 GB) by performing an incremental clone, preserving the full history without manual recreation.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.