简体   繁体   English

将 TFVC 迁移到 Git - 是否应该迁移历史记录?

[英]Migrate TFVC to Git - Should History be migrated?

I'm looking to migrate from TFVC to TFS Git.我希望从 TFVC 迁移到 TFS Git。

I noticed that microsoft recommends:我注意到微软建议:

  • " Due to the differences in how TFVC and Git store version control history, we recommend that you don't migrate your history. " "由于 TFVC 和 Git 存储版本控制历史的方式不同,我们建议您不要迁移您的历史。 "

...without elaborating on why it's not recommended. ...没有详细说明为什么不推荐它。

  • What are the reasons for not migrating history when moving from TFVC to Git?从 TFVC 迁移到 Git 时不迁移历史记录的原因是什么?

For Info: Our codebase is ~9 years old consisting of 2 major projects with ~82k files & ~400k lines of code, and ~90k files and ~500k lines of code供参考:我们的代码库已有约 9 年历史,由 2 个主要项目组成,约 82k 文件和约 400k 行代码,以及约 90k 文件和约 500k 行代码

Eventually found this which provides some information: https://docs.microsoft.com/en-us/devops/develop/git/migrate-from-tfvc-to-git最终发现这提供了一些信息: https://docs.microsoft.com/en-us/devops/develop/git/migrate-from-tfvc-to-git

Before attempting a migration with Git-TFS, be aware that there are fundamental differences between the way TFVC and Git store history:在尝试使用 Git-TFS 进行迁移之前,请注意 TFVC 和 Git 存储历史记录的方式之间存在根本差异:

  • Git stores history as a snapshot of the repository in time, while TFVC records the discrete operations that occurred on a file. Git 将历史记录及时存储为存储库的快照,而 TFVC 记录文件上发生的离散操作。 Change types in TFVC like rename, undelete and rollback cannot be expressed in Git. Git 不能表示 TFVC 中的更改类型,如重命名、取消删除和回滚。 Instead of seeing that file A was renamed to file B, it will only track that file A was deleted and file B was added in the same commit.它不会看到文件 A 被重命名为文件 B,它只会跟踪文件 A 被删除并且文件 B 被添加到同一个提交中。
  • Git does not have a direct analog of a TFVC label. Git 没有 TFVC label 的直接模拟。 Labels can contain any number of files at any specific version and can reflect files at different versions.标签可以包含任何特定版本的任意数量的文件,并且可以反映不同版本的文件。 Although conceptually similar, Git tags point to a snapshot of the whole repository at a point in time.虽然概念上相似,但 Git 标签指向整个存储库在某个时间点的快照。 If the project relies on TFVC labels to know what was delivered, Git tags may not provide this information.如果项目依赖 TFVC 标签来了解交付的内容,则 Git 标签可能不会提供此信息。
  • Merges in TFVC occur at the file level, not at the entire repository. TFVC 中的合并发生在文件级别,而不是整个存储库。 Only a subset of changed files may be merged from one branch to another.只有更改文件的子集可以从一个分支合并到另一个分支。 Remaining changed files may then be merged in a subsequent changeset.然后可以将剩余的更改文件合并到后续更改集中。 In Git, a merge affects the entire repository, and both sets of individual changes cannot be seen as a merge.在 Git 中,合并会影响整个存储库,并且不能将两组单独的更改视为合并。

Because of these differences, it is recommended that users do a tip migration and keep their TFVC repository online, but read-only, in order to view history.由于这些差异,建议用户进行提示迁移并保持其 TFVC 存储库在线,但为只读,以便查看历史记录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM