简体   繁体   English

将我的所有 GitHub 存储库转移到 GitLab 的最快方法是什么?

[英]What is the fastest way to transfer all of my GitHub repositories to GitLab?

I'm looking to move entirely away from GitHub to GitLab as easily as possible.我希望尽可能轻松地完全从 GitHub 转移到 GitLab。

You can import your GitHub projects into GitLab. 您可以将GitHub项目导入GitLab。 If you already have a gitlab account, just go to new (+) --> project --> import --> github. 如果你已经有一个gitlab帐户,只需转到新的(+) - >项目 - >导入 - > github。 More info in: https://gitlab.com/import/github/new 更多信息: https//gitlab.com/import/github/new

1. Begin creating a GitLab project 1.开始创建GitLab项目

In GitLab, choose to create a new project, then go to the Import project tab (instead of the default Blank project ). 在GitLab中,选择创建一个新项目,然后转到Import project选项卡(而不是默认的Blank项目 )。 From th e list of available platforms to automatically import from, select the second option GitHub . 从要自动导入的可用平台列表中,选择第二个选项GitHub

2. Create person access token 2.创建人员访问令牌

You will now need to give GitLab a personal access token that you initiate from GitHub. 您现在需要为GitLab提供一个您从GitHub发起的个人访问令牌。 Login to GitHub and navigate to your per sonal settings. 登录GitHub并导航到您的个人设置。 From there, select Developer settings , then Personal access tokens , then click Generate new token . 从那里,选择开发人员设置 ,然后选择个人访问令牌 ,然后单击生成新令牌 Complete the form that you are prompted with; 填写提示您的表单; the repo scope setting is sufficient for basic transferring. 回购范围设置足以进行基本传输。 Be sure to copy the token to your clipboard when finished. 完成后,请务必将令牌复制到剪贴板。

3. Add personal access token to GitLab 3.将个人访问令牌添加到GitLab

Paste your personal access token into GitLab, then click List your GitHub repositories . 将您的个人访问令牌粘贴到GitLab中,然后单击列出您的GitHub存储库

4. Import the desired projects 4.导入所需的项目

On the rightmost column with the header Status , choose to import all projects that you would like. 在标题为“ 状态”的最右侧列上,选择导入您想要的所有项目。 If you would like to import all repositories at the same time, you can select the green button Import all repositories at the top. 如果要同时导入所有存储库,可以选择顶部的绿色按钮导入所有存储库

For more information, please refer to the detailed post by GitLab on the topic by clicking on the image or link below: 有关详细信息,请单击下面的图像或链接,参阅GitLab关于该主题的详细信息:

在此输入图像描述

https://docs.gitlab.com/ee/user/project/import/github.html https://docs.gitlab.com/ee/user/project/import/github.html

只需在本地存储库中添加一个GitLab repo作为另一个远程仓库并推送到它。

Please follow this, i think this will be helpful for you. 请关注此,我认为这对您有所帮助。 1. Create a project repository in gitlab. 1.在gitlab中创建项目存储库。 2. Then your existing project repository added another remote url.(git remote add 'name' 'new repository') 3. And Then push your project to that remote url. 2.然后您现有的项目存储库添加了另一个远程URL。(git remote add'name''new repository')3。然后将您的项目推送到该远程URL。 (git push 'name' master.) (git push'name'master。)

Note that GitLab 14.10 (April 2022) does simplify the process:请注意, GitLab 14.10 (2022 年 4 月)确实简化了流程:

Importing from GitHub defaults to the current group path从GitHub导入默认为当前组路径

When importing from GitHub, this milestone changes the default destination for imported projects to the contextual namespace of the GitLab group from which you started the import.当从 GitHub 导入时,此里程碑将导入项目的默认目标更改为开始导入的 GitLab 组的上下文命名空间。

Previously, GitHub projects imported to your personal namespace.以前,GitHub 个项目导入到您的个人命名空间。

This usability enhancement helps users import projects in a more intuitive way and doesn't place imported projects in confusing locations.这种可用性增强可帮助用户以更直观的方式导入项目,并且不会将导入的项目放在混乱的位置。

https://www.youtube.com/watch?v=yKaf4LeEFoU

See Documentation and Issue .请参阅文档问题


And it comes with:它带有:

View history of all project imports on a single page在单个页面上查看所有项目导入的历史记录

The new Project import history page lists all project imports, regardless of where they were imported from.新的项目导入历史页面列出了所有项目导入,无论它们是从哪里导入的。 This view consolidates information that was previously scattered on the import pages of each individual importer.此视图整合了以前分散在每个单独进口商的进口页面上的信息。

Having all the details about previous imports in one view gives you a single place to find and review the status of all previous imports.在一个视图中包含有关先前导入的所有详细信息,使您可以在一个地方查找和查看所有先前导入的状态。 This includes details on imports that failed, so that you can verify that you successfully imported all the intended projects.这包括有关导入失败的详细信息,以便您可以验证是否已成功导入所有预期项目。

https://about.gitlab.com/images/14_10/view_history_of_all_project_imports_on_a_single_page.png -- 在单个页面上查看所有项目导入的历史记录

See Documentation and Issue .请参阅文档问题

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

相关问题 将 git 存储库从 GitLab 转移到 GitHub - 我们可以,如何转移和陷阱(如果有的话)? - Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)? 将多个 gitlab 存储库迁移到 github - 如何一次完成所有操作(而不是手动) - Migrate multiple gitlab repositories to github - how to do it all at once (instead of manually) 如何同步两个存储库(在github中一个和gitlab中)的所有分支,以防止合并冲突? - How to sync all branches of two repositories (one in github and one in gitlab) preventing merge conflicts? 查找 Github 中的所有空存储库 - Find all empty repositories in Github 在我的 Github 上显示协作存储库 - Displaying collaborated repositories on my Github 下载 GitHub 项目的最快方法 - Fastest way to download a GitHub project 将仓库从gitlab自托管服务器迁移到github账号 - Migration of repositories from gitlab self-hosted server to github account 通过 gitlab(或 git)合并分支的最快方法? - Fastest way to merge branches via gitlab (or git)? 在Java项目中获取所有构建错误的最快方法是什么? - What's the fastest way to get all build errors in a Java project? 有没有办法从命令行或 git 使您在 GitHub 中的所有存储库/存储库成为私有的? - Is there a way to make all your repositories / repos in GitHub Private from commandline or git?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM