使用 git-tfs 工具将 TFS 迁移到 GIT 不迁移所有分支和分支的一些更改
Migration of TFS to GIT using git-tfs tool not migrating all the branches and some changes of branches
我正在尝试使用 git-tfs 工具将 TFS 迁移到 GIT 以及所有具有历史记录的分支。但是我只成功地获得了少数分支,而其他分支则缺少历史记录(最近一次)。很少有分支甚至没有迁移。
我使用以下命令进行迁移:
git tfs clone <tfsurl> <trunk> --branches=All --debug
我在调试日志中收到以下分支和变更集错误:
Looking for changeset 78197 in git repository: CacheIsFull, stopped looking.
error: an error occurs when initializing the branch. Branch is ignored and continuing...
我也在相关的 post 中查找过类似问题,但其中 none 提供了解决方案。例如:
https://github.com/git-tfs/git-tfs/issues/461
我希望将所有分支和历史从 TFS 迁移到 GIT 存储库。
这不是由第 3 方团队处理的官方工具。并根据 their description:
This project is no more actively maintained because we are no more
users of TFS. Thus being very useful, git-tfs is not exempt of not
supported use cases. If you encounter something missing or a problem,
please contribute, we will be pleased to help you.
And remember:
The fastest way to get an issue fixed is to submit a PR that fixes it.
The slowest way to get it fixed is to hope someone else will fix it.
在尝试使用 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. Change
types in TFVC like rename, undelete and rollback cannot be expressed
in Git; instead of seeing that file A was renamed to file B, you may
only see that file A was deleted and file B was added in the same
commit.
- Git does not have a direct analog of a 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. If you rely on TFVC labels to know what was delivered, Git
tags may not be provide this information.
- Merges in TFVC occur at the file level, not at the entire repository. You can merge only a subset of changed files from one
branch to another, then merge the remaining changed files in a
subsequent changeset. In Git, a merge affects the entire
repository, and you cannot see both sets of individual changes as a
merge.
由于这些差异,我们通常建议用户进行提示迁移并保持其 TFVC 存储库在线但只读以查看历史记录。
这是 Microsoft 在将 Windows 和其他产品从集中式版本控制迁移到 Git 时采用的方法。
tip迁移,使用官方TFVC import tool即可。
如果你坚持使用git-tfs,我也经历过一些类似的问题,有多个根本原因,例如一些分支被重命名(删除并创建一个新分支),无限循环拉取特定分支、死分支、长克隆等。
似乎有几种方法和解决方法。您可能需要深入研究它们并根据自己的情况找到正确的方法。
我正在尝试使用 git-tfs 工具将 TFS 迁移到 GIT 以及所有具有历史记录的分支。但是我只成功地获得了少数分支,而其他分支则缺少历史记录(最近一次)。很少有分支甚至没有迁移。 我使用以下命令进行迁移:
git tfs clone <tfsurl> <trunk> --branches=All --debug
我在调试日志中收到以下分支和变更集错误:
Looking for changeset 78197 in git repository: CacheIsFull, stopped looking.
error: an error occurs when initializing the branch. Branch is ignored and continuing...
我也在相关的 post 中查找过类似问题,但其中 none 提供了解决方案。例如: https://github.com/git-tfs/git-tfs/issues/461
我希望将所有分支和历史从 TFS 迁移到 GIT 存储库。
这不是由第 3 方团队处理的官方工具。并根据 their description:
This project is no more actively maintained because we are no more users of TFS. Thus being very useful, git-tfs is not exempt of not supported use cases. If you encounter something missing or a problem, please contribute, we will be pleased to help you.
And remember:
The fastest way to get an issue fixed is to submit a PR that fixes it.
The slowest way to get it fixed is to hope someone else will fix it.
在尝试使用 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. Change
types in TFVC like rename, undelete and rollback cannot be expressed
in Git; instead of seeing that file A was renamed to file B, you may
only see that file A was deleted and file B was added in the same
commit.- Git does not have a direct analog of a 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. If you rely on TFVC labels to know what was delivered, Git tags may not be provide this information.
- Merges in TFVC occur at the file level, not at the entire repository. You can merge only a subset of changed files from one branch to another, then merge the remaining changed files in a subsequent changeset. In Git, a merge affects the entire repository, and you cannot see both sets of individual changes as a merge.
由于这些差异,我们通常建议用户进行提示迁移并保持其 TFVC 存储库在线但只读以查看历史记录。
这是 Microsoft 在将 Windows 和其他产品从集中式版本控制迁移到 Git 时采用的方法。
tip迁移,使用官方TFVC import tool即可。
如果你坚持使用git-tfs,我也经历过一些类似的问题,有多个根本原因,例如一些分支被重命名(删除并创建一个新分支),无限循环拉取特定分支、死分支、长克隆等。
似乎有几种方法和解决方法。您可能需要深入研究它们并根据自己的情况找到正确的方法。