【问题标题】:Azure DevOps - Moving TVCS Repo from one tenant to another - 2021Azure DevOps - 将 TVCS 存储库从一个租户转移到另一个租户 - 2021
【发布时间】:2021-11-06 22:03:51
【问题描述】:

在发布这个问题之前,我已经查看了所有类似的问题。找不到可行的解决方案,我正在寻求帮助。

提前致谢!

我正在尝试使用以下方法将存储库从一个租户复制到另一个租户:

  1. (完成)下载工具:从微软官方下载中心下载适用于 Visual Studio Team Foundation Server 和 Visual Studio Online 的 Microsoft Git-TF

  2. (完成)下载 Git-TF 和 Git-TFS(使用 git-tfs 完成)

  3. 使用 Git-Tf 工具将现有的 TFVC 存储库作为 Git 存储库克隆到我的本地计算机: git-tf clone https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep git-tf 不再受支持,所以我使用了git-tfs 在这里。 git-tfs 克隆 https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep

  4. (done) cd 到代码被克隆到的目录并将本地 Git repo 推送到任何空的远程 Git repo(这将在迁移期间用作临时 repo) git remote add origin https://user @dev.azure.com/myorg/anyteamproject/_git/tempgitrepo git push -u origin –all

  5. (使用 git-tfs 完成)将临时 Git 存储库克隆到我的本地计算机 git-tfs clone https://user@dev.azure.com/myorg/anyteamproject/_git/tempgitrepo

  6. (完成)在现有的目标 TFVC 存储库中创建了一个“已迁移”的空新文件夹(使用 git-ft 完成,但从这一步开始我不确定它现在是否正确) cd 到代码被克隆的目录进入并运行配置命令: git-tf configure https://dev.azure.com/myorg/ "$/mytargetteamproject/migrated" (这里 git-tf 不是由于基本身份验证问题,因为它不再受支持。使用 gif-tfs 导致引导到租户我们想从 - 复制到原始)

  7. 运行 pull 命令合并两个 repos 不起作用 - git-tf pull 导致引导到错误的租户 - git-tfs pull 下面的步骤根本无法执行,因为步骤 8 无法正确完成。

  8. 运行一个基本的 git commit 命令 git commit -a -m "merge commit"

  9. 签入到 TFVC 仓库 git-tf checkin –deep --metadata

问题是 - 有没有办法将 TVCS 存储库从一个租户转移到另一个 TVCS 租户存储库?

【问题讨论】:

  • 不要使用git-tf。它不再受支持,并且严格不如具有相似名称的其他工具,git-tfs

标签: tfs tfvc


【解决方案1】:

最后,我设法——不仅是因为我——进行了迁移。 不幸的是,git-tfs 无法使用,因为它不像 git-tf 那样工作。

主要问题是使用 git-tf 的授权步骤。 相应地使用令牌名称和令牌作为用户名和密码有很大帮助。

完成的所有步骤如下所示:

  1. 安装 GIT、GIT-TF、Java

  2. 将源存储库克隆到本地 GIT

    git-tf clone https://azerov:[source token]@dev.azure.com/OrganizationName "$/D365FOps_Learn02/Trunk" --deep
    username: TestPatMigration (the name of the token)
    password: [source token]
    
  3. 创建任何远程 GIT 存储库以将本地克隆存储库推送到那里

  4. cd 到克隆的 repo c:\users[curuser]\Trunk

    git remote add origin 
    https://azerov:[git temporary target token]@dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02**
    
  5. 将本地克隆仓库推送到临时 GIT 仓库

    git push -u origin –-all
    
  6. 将临时 git repo 克隆到本地机器

    git clone https://azerov:[git temporary target token]@dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02
    
  7. 配置目标 TFVS 项目以将本地临时 GIT 存储库推送到那里

    cd into c:\users\GitTemp2
    git-tf configure https://azerov:[git temporary target token]@dev.azure.com/OrganizationNameTarget/ “$/D365FOps_learn02/Trunk”
    
  8. git-tf pull
    
    Username:  PATMigration (the name of the target source token)
    password: [git temporary target token]
    
  9. git commit -a -m "merge commit"
    
  10. git-tf checkin –-deep –-metadata
    

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-28
    • 1970-01-01
    • 1970-01-01
    • 2022-11-23
    • 1970-01-01
    • 2021-05-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多