简体   繁体   English

从TFS迁移-> GIT…如何保留分支的历史记录

[英]Migrating from TFS -> GIT… How to preserve the history with branches

I need to move our relatively large codebase out of TFS and into git and preserve history. 我需要将相对较大的代码库移出TFS并移入git并保留历史记录。 Plenty of examples out there for doing this but none cover what happens with branches in tfs that need to become branches in cloned git repo. 那里有很多 示例 ,但是没有一个例子涵盖tfs中需要成为克隆的git repo中的分支的分支所发生的情况。

If you try these examples your cloned repo will only have a master branch with sub-folders for each TFS branch. 如果尝试这些示例,则克隆的存储库将仅具有一个主分支,每个TFS分支都带有子文件夹。 This is a serious issue because source code history between branches will be lost. 这是一个严重的问题,因为分支之间的源代码历史记录将丢失。

From what I can see no tool exists that will migrate and reliably preserve history, but please prove me wrong by answering this question. 据我所知,没有工具可以迁移并可靠地保存历史,但是请回答此问题以证明我错了。

Edit: This link suggests that there is no support for proper migration 编辑: 此链接建议不支持适当的迁移

git-tf maps a single TFS folder for example $/project/main to a git repository. git-tf将单个TFS文件夹(例如$ / project / main)映射到git存储库。 We do not mirror/map TFS branches to git branches because branches are fundamentally different in both systems. 我们不会将TFS分支镜像/映射到git分支,因为这两个系统中的分支根本不同。

Edit 2: git-tfs seems to be a better tool for exporting from TFS , it respects branching but it seems to fail when importing larger TFS codebases where branches have been renamed. 编辑2: git-tfs似乎是从TFS导出的更好的工具 ,它尊重分支,但在导入已重命名分支的更大的TFS代码库时,它似乎失败。 There is a pull request of the project which shows progress but still gets caught in some infinite loop when importing. 该项目有一个请求请求,该请求显示进度,但在导入时仍然陷入无限循环。

I hope there is a git command that fixes this issue 我希望有一个git命令可以解决此问题

I was able to successfully convert my repo by fixing a few minor bugs in git-tfs codebase and a few minor changes to my TFS repo. 通过修复git-tfs代码库中的一些小错误以及对我的TFS存储库的一些小改动,我能够成功地转换我的存储库。 Details below. 详细信息如下。

Bottom line: with a little perserverance you can clone TFS repos into git without data loss . 底线:只需稍加保留,您就可以将TFS存储库克隆到git中,而不会丢失数据 https://github.com/git-tfs/git-tfs/pull/480 https://github.com/git-tfs/git-tfs/pull/480

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

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