Permalink
Switch branches/tags
7-11-stable-ee 7-12-stable-ee 7-13-stable-ee 7-14-stable-ee 8-0-stable-ee 8-1-stable-ee 8-2-6-changelog-entries 8-2-stable-ee 8-3-stable-ee 8-4-stable-ee 8-5-stable-ee 8-6-stable-ee 8-7-stable-ee 8-8-stable-ee 8-9-stable-ee 8-10-stable-ee 8-11-stable-ee-to-master 8-11-stable-ee 8-12-stable-ee 8-13-stable-ee 8-14-stable-ee 672-import_url-nil 675-protected-branch-specific-groups 789-geo-clone-ui 882-deny-delete-tag-regression 886-incomplete-information-setting-up-pages-domain 939-repositoryupdatemirrorworker-updatemirrorerror-rugged-invaliderror-cannot-set-empty-url 1165-jej-remote-mirror-validation-failures 1184-do-not-email-blocked-users 1251-clarify-elasticsearch 1289-merge-request-serializer-breaks 12726-preserve-issues-after-deleting-users-ee 15343-build-settiings 21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access-ee 22253-move-lfshelper-methods-somewhere-else-than-app-helpers-ee 22719-provide-a-new-gitlab-workhorse-install-rake-task-similar-to-gitlab-shell-install-ee 23100-slow-query-number-of-potential-approvers 23945-improve-ee_compat_check-task-part-3-ee 24669-merge-request-dashboard-page-takes-over-a-minute-to-load-ee 25011-hoverstates-for-collapsed-issue-merge-request-sidebar-EE adding_missing_info_to_ldapee approver-ui ce-8-5-stable-to-ee-8-5-stable-ee ce-5824-ee-581-backport-changes ce-21170-cycle-analytics ce-stable-upstream ce-to-ee-merge-check-rake-task-ee ce_issue_18759 disable-prev-next-8.8.3-ee doc/sentinel-ee docs/geo-improvements docs/git-filter-branch ee-870-backport-ee ee-1137-follow-up-protected-branch-users-and-groups-ee ee-new-diff-notes elasticsearch_ es_add_explamnation_comments es_search_through_filenames expose-add-ons-in-license-api fe-multiple-issue-boards fe-time-tracking feature/cycle-analytics-events-ee-tmp file_lock fix-8-12-stable-ee fix-broken-spec fix-ee-master fix-ldap-group-sync fix-more-orphans-remove-undeleted-groups-ee fix-protected-branch fix/ce-14503 fix_change_access fix/es-instrumentation fix/remote-mirror-url fix_remove_source_branch fix_rubocop_complains fix_slack_notification_build fix/user-activities-config fix/396 gitlab-pages grapify-projects-api-ee group-sync-update-perms group_approvers_ issue-weight-range issue_385 issue_587 issue_828-ee issue_1008_1-ee issue_22944-ee kerberos-ssh-lfs-test knapsack-ee master max-file-size-git-hook mrchrisw/admin-sync mrchrisw/ldap-docs mrchrisw/ldap-snip-apostrophe mrchrisw/ldap-timeout mrchrisw/ldap-unicode-docs mrchrisw/sync-times patch/load_average prevent-committing-secrets-ui-first-iteration project-settings-tooltips rc-improve-members-destroy-service-ee refactor-appearance refactor-issuable-title-form-ee remove_annotate require-ee-ldap-properly revert-9b9a31c7 rs-issue-99 settings_getter_fix sh-812-stable-ee-test sh-test-8-9-stable-ee show_hide_credentials sidebar-updates sidekiq-cluster stable-fixes test_search test time-tracking-backend timetracking-1.1 update-changelog-8-8-5-ee update-for-ee-stable use-current-active-users-for-license use-xml-lexer-for-svg-files use_redis_pool_for_geo user-activity-front-end users_select_tag_helper verbose_git_hooks
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (88 sloc) 5.3 KB

Import your project from GitHub to GitLab

Import your projects from GitHub to GitLab with minimal effort.

Overview

Note: If you are an administrator you can enable the GitHub integration in your GitLab instance sitewide. This configuration is optional, users will be able import their GitHub repositories with a personal access token.

  • At its current state, GitHub importer can import:
    • the repository description (GitLab 7.7+)
    • the Git repository data (GitLab 7.7+)
    • the issues (GitLab 7.7+)
    • the pull requests (GitLab 8.4+)
    • the wiki pages (GitLab 8.4+)
    • the milestones (GitLab 8.7+)
    • the labels (GitLab 8.7+)
    • the release note descriptions (GitLab 8.12+)
  • References to pull requests and issues are preserved (GitLab 8.7+)
  • Repository public access is retained. If a repository is private in GitHub it will be created as private in GitLab as well.

How it works

When issues/pull requests are being imported, the GitHub importer tries to find the GitHub author/assignee in GitLab's database using the GitHub ID. For this to work, the GitHub author/assignee should have signed in beforehand in GitLab and associated their GitHub account. If the user is not found in GitLab's database, the project creator (most of the times the current user that started the import process) is set as the author, but a reference on the issue about the original GitHub author is kept.

The importer will create any new namespaces (groups) if they don't exist or in the case the namespace is taken, the repository will be imported under the user's namespace that started the import process.

Importing your GitHub repositories

The importer page is visible when you create a new project.

New project page on GitLab

Click on the GitHub link and the import authorization process will start. There are two ways to authorize access to your GitHub repositories:

  1. Using the GitHub integration (if it's enabled by your GitLab administrator). This is the preferred way as it's possible to preserve the GitHub authors/assignees. Read more in the How it works section.
  2. Using a personal access token provided by GitHub.

Select authentication method

Authorize access to your repositories using the GitHub integration

If the GitHub integration is enabled by your GitLab administrator, you can use it instead of the personal access token.

  1. First you may want to connect your GitHub account to GitLab in order for the username mapping to be correct. Follow the social sign-in documentation on how to do so.
  2. Once you connect GitHub, click the List your GitHub repositories button and you will be redirected to GitHub for permission to access your projects.
  3. After accepting, you'll be automatically redirected to the importer.

You can now go on and select which repositories to import.

Authorize access to your repositories using a personal access token

Note: For a proper author/assignee mapping for issues and pull requests, the GitHub integration should be used instead of the personal access token. If the GitHub integration is enabled by your GitLab administrator, it should be the preferred method to import your repositories. Read more in the How it works section.

If you are not using the GitHub integration, you can still perform a one-off authorization with GitHub to grant GitLab access your repositories:

  1. Go to https://github.com/settings/tokens/new.
  2. Enter a token description.
  3. Check the repo scope.
  4. Click Generate token.
  5. Copy the token hash.
  6. Go back to GitLab and provide the token to the GitHub importer.
  7. Hit the List your GitHub repositories button and wait while GitLab reads your repositories' information. Once done, you'll be taken to the importer page to select the repositories to import.

Select which repositories to import

After you've authorized access to your GitHub repositories, you will be redirected to the GitHub importer page.

From there, you can see the import statuses of your GitHub repositories.

  • Those that are being imported will show a started status,
  • those already successfully imported will be green with a done status,
  • whereas those that are not yet imported will have an Import button on the right side of the table.

If you want, you can import all your GitHub projects in one go by hitting Import all projects in the upper left corner.

GitHub importer page


You can also choose a different name for the project and a different namespace, if you have the privileges to do so.