'Migrating TFS 2015 repo historical file changesets to git repo [duplicate]

A code base was moved from TFS to Azure/Git though when I view file history in git the history starts at the date of migration.

Rather than logging into the TFS repo and staying online to view file history, I would like to export these changesets from TFS and see historical changes from all files locally in git.



Solution 1:[1]

You can migrate code from an existing TFVC repository to a new Git repository within the same organization. Migrating to Git is an involved process for large TFVC repositories and teams. Centralized version control systems, like TFVC, behave different than Git in fundamental ways. The switch involves a lot more than learning new commands. It is a disruptive change that requires careful planning. You need to think about:

  • Revising tools and processes
  • Removing binaries and executables
  • Training your team

We prefer you to update your TFS version to TFS 2017 Update 2 or later version.

We strongly recommend reading our whitepapers - Centralized version control to Gitand TFVC to Git before starting the migration.

The import experience is great for small simple TFVC repositories. It's also good for repositories that have already been "cleaned up" as outlined in the previous whitepapers. Those whitepapers also recommend other tools for more advanced TFVC repository configurations.

! Important

Due to the differences in how TFVC and Git store version control history, we recommend that you don't migrate your history. This is the approach that Microsoft took when it migrated Windows and other products from centralized version control to Git.

Importing the repository

  1. Select Repos, Files.

enter image description here

  1. From the repo drop-down, select Import repository.

enter image description here

  1. Select TFVC from the Source type dropdown

  2. Type the path to the repository / branch / folder that you want to import to the Git repository. For example, $/Fabrikam/FabrikamWebsite

  3. If you want to migrate history from the TFVC repository, click Migrate history and select the number of days. You can migrate up to 180 days of history starting from the most recent changeset. A link to the TFVC repository is added in the commit message of the 1st changeset that is migrated to Git. This makes it easy to find older history when needed.

  4. Give a name to the new Git repository and click Import. Depending on the size of the import, your Git repository would be ready in a few minutes.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kangcheng Jin-MSFT