git-tfs 尝试克隆 TFVC 存储库时联系服务器时出错

git-tfs when trying to clone TFVC repo error contacting server

我正在尝试将存储库从前同事托管的 TFVC 转移到新的 azure devops 帐户(将使用 git)。通过研究,我发现将其与历史一起移动的唯一可能性是在命令行中使用 git-tfs 工具。当我 运行 这个:

git tfs clone -u xxxx -p xxxx https://acctname.visualstudio.com/project/_versionControl?path=%24/repo/folder $/https://dev.azure.com/newaccount/newproject/_git/newrepo .

我弹出了一个登录 Microsoft 帐户的弹出窗口,成功登录后我得到了这个:

Please contact your administrator. There was an error contacting the server.
Technical information (for administrator):
  HTTP code 200: OK

我对此束手无策。如果有人有更好的处理整个动作的方法,我也很乐意听到。

调用 git tfs clone 将尝试在您朋友的原始 Azure DevOps 实例上创建 TFVC 存储库的本地副本。它不会通过单个命令将存储库从一台服务器镜像到另一台服务器。创建本地副本后,您可以将新帐户添加为远程帐户,然后将更改推送到新帐户。

git tfs clone https://acctname.visualstudio.com/ $/project
git remote add target https://dev.azure.com/newaccount/newproject/_git/newrepo
git push -u target main
// Optionally push other branches too.

但是可能有更简单的方法来做到这一点。在 Azure DevOps(以及他的所有帐户)中,源帐户中的新空白存储库上有一个导入选项。在存储库 drop-down 中,选择 'import repository' 并将其指向您的 TFVC 主分支。这将转换最多 180 天的历史记录,并在源帐户中为您创建一个 git 存储库。如果你想要超过 180 天的历史记录,githtfs 是唯一的方法。

然后您可以在新帐户上使用相同的导入存储库选项,将 git 存储库从旧帐户直接转移到新帐户中。

如果您将源帐户与具有至少 'Code (Read)' 权限的个人访问令牌结合使用,则可以让 Azure DevOps 为您执行迁移。

参见: