Operations 6 min read

Migrating from TFVC to Git While Preserving History

This article explains why many teams still use TFVC, compares its centralized features with Git's distributed advantages, and provides a step‑by‑step TFVC‑to‑Git migration procedure that retains full commit history and offers guidance on choosing the right repository strategy.

DevOps
DevOps
DevOps
Migrating from TFVC to Git While Preserving History

Git has become the dominant distributed version control system, offering fast operations, flexible branching, and peer‑to‑peer sharing, while many large teams still rely on centralized systems like TFVC for features such as file‑level permissions and binary storage efficiency.

Since TFS/VSTS added Git support in 2012, projects could not mix TFVC and Git repositories in the same project, forcing users to create separate Git projects and switch between them. Starting with TFS 2015 Update 1, TFVC and Git repositories can coexist within a single project.

When deciding whether to keep both repositories or migrate parts of a project, teams should consider factors such as the amount of binary assets (documents, spreadsheets) that non‑technical users need to manage, the need for fine‑grained permission control, and the size of the codebase that may benefit from separate Git repos.

TFVC‑to‑Git migration with history preservation

Use the git‑tf clone command with the --deep option to convert a TFVC path (e.g., $/TeamProjectA/Main) into a local Git repository that retains the full TFVC changeset history.

# --deep ensures all TFVC changesets become Git commits
# $/TeamProjectA/Main can point to any sub‑folder to migrate only part of the repo
git‑tf clone http://myserver:8080/tfs $/TeamProjectA/Main --deep

After cloning, link the local repository to a remote Git server and push all branches:

git remote add origin http://myserver:8080/tfs/{collectionName}/{projectName}/_git
git push -u origin --all

Once the new Git repository is ready, teams can organize the code into separate repos, use submodules or package managers for cross‑repo dependencies, and benefit from the distributed workflow while retaining the advantages of TFVC where needed.

In summary, converting TFVC to Git requires weighing the trade‑offs between centralized and distributed models, project structure, and collaboration patterns to design an optimal source‑control strategy.

References: TFS Power Tools (allows Windows Explorer check‑in/out) and git‑tf (Microsoft’s TFVC‑to‑Git conversion tool). Links provided for download.

Follow the devopshub WeChat public account for more DevOps information.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

migrationDevOpsGitVersion ControlTFVC
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.