【问题标题】:Migrate from tfs to git on visualstudio.com在 visualstudio.com 上从 tfs 迁移到 git
【发布时间】:2013-11-02 03:22:49
【问题描述】:

我在 visualstudio.com(一个免费帐户)上有一个远程存储库,但它在 tfs 上,我想将它移动到 git for visualstudio.com

有人试过吗?

我找到了这个教程:

http://gitstack.com/how-to-migrate-from-tfs-to-git/

但是其中有一个命令git tfs clone http://tfs:8080/tfs/DefaultCollection $/TeamProject/git_folder,它从 tfs 复制到另一个文件夹并转换为 git。

如何在远程 visualstudio.com 服务器中创建单独的 (git) 文件夹?

在执行此操作时,它会要求我的 Windows Live id 进行身份验证还是有任何命令行命令?

【问题讨论】:

标签: git tfs azure-devops


【解决方案1】:

搞定了,正确的命令是在 DefaultCollection 之后使用 https 而不使用项目名称,例如:

git-tfs clone --username=mumair85 --password=xxxx https://mumair85.visualstudio.com/DefaultCollection $/uGen

【讨论】:

  • 如果您有 TFS 分支,请记住使用 --with-branches 来克隆所有内容。
  • 如果您签入了二进制文件和许多分支,请小心使用 --with-branches。克隆所有内容可能需要数周时间,而且 Git-TFS 无法在克隆之前设置 LFS。
【解决方案2】:

如果您在 Windows 上使用 Git Credential Manager(包含在最新版本的 Git for Windows 中),那么它将提示您登录到 Visual Studio Team Services 并为您设置身份验证。您无需手动设置备用身份验证令牌。

要使用git(没有 Git 凭据管理器)、git-tfsgit-tf,您需要为您的 Team Foundation 服务帐户使用 set up Alternate Credentials

  1. 点击任意 TFS 网页右上角的你的名字
  2. 选择“凭据”标签
  3. 选择“启用备用凭据”
  4. 输入新的用户名和密码组合

然后,您可以使用此用户名/密码组合从命令行应用程序进行身份验证。

【讨论】:

  • 我已经启用了它,并通过主要和次要用户名尝试使用以下命令,并且正在将此命令用于 git-tfs:'git-tfs clone --username=mumair85 --password=xxxx mumair85.visualstudio.com/DefaultCollection/uGen $/u Gen' 其中 DefaultCollection/uGen 是我要克隆到 /uGen 目录的项目。它给了我这个错误:TF31002: Unable to connect to this Team F S
  • 好的,正确的命令是在 DefaultCollection 之后使用没有项目名称的 https:'git-tfs clone --username=mumair85 --password=xxxx https://mumair85.visualstudio.com/ DefaultCollection $/uGen'
  • 签入等的所有历史记录是否也迁移到了 GIT?
  • 只是为了记录,我不需要对凭据做任何事情,我已经用 Visual Studio 连接到 tfs,当我运行 git tfs clone 时没有任何额外的凭据,它就可以工作
  • 如果您使用的是安装了 Git 凭据管理器的 Windows 版 Git,则不再需要备用凭据。它会提示您通过 UI 弹出来对 VSTS 进行身份验证,或使用缓存的凭据。
猜你喜欢
  • 2011-02-21
  • 2017-01-30
  • 2019-08-11
  • 2016-04-20
  • 1970-01-01
  • 2013-12-24
  • 2021-06-09
  • 2014-01-18
  • 2019-03-16
相关资源
最近更新 更多