本文介绍了如何将 GIT 存储库从 Bonobo GIT Server 导入 Visual Studio Team Services的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 Visual Studio Team Services(在 VisualStudio.com 上)支持 Git 存储库,我们希望摆脱托管在 Azure 机器上的我们自己的 Git 服务器 (Bonobo Git).

在我们可以关闭 Bonobo Git 服务器之前,我需要将这些存储库导入到 VSTS.

从第一个存储库开始它已经失败了:

  • 我尝试使用通用的 .git URL.我可以使用这个 URL 在我的本地机器上克隆 repo.我还尝试了包含我的电子邮件的个人 URL,但没有成功.
  • 我尝试过和未经授权.用户名是我在 Bonobo Git 服务器上的管理员用户的电子邮件和密码.
  • 我没有导入到现有存储库,而是尝试将存储库作为新存储库导入.
  • 源代码库不为空.

我怎样才能使这个导入工作?

解决方案

我可以在我这边重现这个问题.

如果您想从 Internet 导入某些内容,您将需要Internet 访问.所以首先要确保 VSTS 可以访问 Bonobo Git 服务器.您可以尝试通过代理连接 Bonobo Git 服务器.参考这个类似的线程:

Since Visual Studio Team Services (on VisualStudio.com) is supporting Git repositories, we want to get rid of our own Git server (Bonobo Git) that is hosted on an azure machine.

Before we can shutdown the Bonobo Git server I need to import those repositories to VSTS.

Starting with the first repository it already fails:

  • I tried to use the general .git URL. I could clone the repo on my local machine using this URL. I also tried the personal URL that includes my email, without success.
  • I tried with and without authorization. Username are email and password of my admin user on the Bonobo Git server.
  • Instead of importing to an existing repo, I also tried to import the repo as new repo.
  • The source repo is not empty.

How can I make this import to work?

解决方案

I can reproduce this issue on my side.

If you want to import something from the Internet, you're going to need Internet access. So make sure VSTS can access the Bonobo Git server first. You can try connecting the Bonobo Git server through a proxy. Reference this similar thread : Unable to import a git repository into TFS 2017.3

And another workaround is Manually import the git repository (works as expected on my side):

  1. Create and cd to a temp folder, then run below command:

    git clone --bare http://172.17.16.147/Bonobo.Git.Server/Test0523.git

    cd Test0523.git

  2. Create a target git repository in VSTS (e.g.https://xx.visualstudio.com/GIT/_git/Git0523)

  3. Run below command to copy the source repo to the target repo. (It will popup the dialog to let you enter the credential to access VSTS in this step.)

    git push --mirror https://xx.visualstudio.com/GIT/_git/Git0523

    cd ..

    rm -rf Test0523.git

这篇关于如何将 GIT 存储库从 Bonobo GIT Server 导入 Visual Studio Team Services的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 20:19