git-tfs在尝试克隆TFVC repo时联系服务器时出错



我正试图将一个由前同事托管的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 .

我得到一个弹出窗口来登录到微软帐户,在成功登录后,我得到了这个:

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(以及他的所有帐户(中,源帐户中的新空白存储库上有一个导入选项。在"存储库"下拉列表中,选择"导入存储库"并将其指向TFVC主分支。这将转换长达180天的历史记录,并在源帐户中为您创建一个git回购。如果你想要超过180天的历史,githtfs是唯一的方法。

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

如果您将源帐户与至少具有"代码(读取("权限的个人访问令牌组合传入,则可以让Azure DevOps为您执行迁移。

参见:

  • https://learn.microsoft.com/en-us/azure/devops/repos/git/import-from-tfvc?view=azure-devops

最新更新