简体   繁体   English

GitLab 上来自 Azure 存储库的镜像存储库

[英]Mirror repository from Azure repos on GitLab

I need to mirror a repository in Azure Repos with a repository in GitLab (pull), on Gitlab it asks me to insert the repository URL (which I have) and it asks me for a password, I've tried with my outlook password and some credentials I created on Azure Repos, but none are working.我需要用 GitLab 中的存储库镜像 Azure Repos 中的存储库(拉),在 Gitlab 上它要求我插入存储库 URL(我有)并要求我输入密码,我已经尝试使用我的 Outlook 密码和我在 Azure Repos 上创建的一些凭据,但没有一个有效。 Is there another password?有其他密码吗?

在此处输入图片说明

I had no problem mirroring from GitHub, but I haven't been able to do the same with Azure Repos, and I'd like to have everything on GitLab.我从 GitHub 镜像没有问题,但我无法使用 Azure Repos 做同样的事情,我希望在 GitLab 上拥有所有内容。

I'm trying this: https://docs.gitlab.com/ee/workflow/repository_mirroring.html我正在尝试这个: https : //docs.gitlab.com/ee/workflow/repository_mirroring.html

Thanks!谢谢!

First your have to create your personal access token in Azure DevOps (see user settings).首先,您必须在Azure DevOps 中创建您的个人访问令牌(请参阅用户设置)。 The name of the token will be the username which you have to use in GitLab.令牌名称将是您必须在 GitLab 中使用的用户名 A scope of "Code : read" should be enough for the token. “代码:读取”的范围应该足以用于令牌。

In GitLab you have to use the url as described in the help :在 GitLab 中,您必须使用帮助中描述的 url:

  • Include the username in the URL if required: https://username@gitlab.company.com/group/project.git .如果需要,请在 URL 中包含用户名: https://username@gitlab.company.com/group/project.git

The username is the name of your DevOps token.用户名是您的 DevOps 令牌的名称。 And as the password you have to use the token himself.作为密码,您必须自己使用令牌。

To add on previous solution.添加以前的解决方案。 I was able to mirror without creating a token我能够在不创建令牌的情况下进行镜像

For pull Request:对于拉取请求:

https://<username>@gitlab.com/group.project.git

Username: your gitlab username Password: your gitlab password用户名:您的 gitlab 用户名 密码:您的 gitlab 密码

Try pulling the repo locally using this command尝试使用此命令在本地拉取 repo

git clone https://<username>:<password>@gitlab.com/group/project.git

If git clone works, then mirroring should work as well如果 git clone 有效,那么镜像也应该有效

Note : that having an "@" in your password fails the git command.注意:密码中包含“@”会使 git 命令失败。 this is usual suspect这是通常的嫌疑人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM