Text of docs.gitlab.com › user › project › import › github as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Migrate from GitHub | GitLab Docs

/ Migrate from GitHub Tier : Free, Premium, Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated Imported badge introduced in GitLab 17.2. Use alternative comments import method checkbox removed in GitLab 19.4. This comments import method is now always used for new imports and cannot be turned off. You can import your GitHub projects from either GitHub.com or GitHub Enterprise. Importing projects does not migrate or import any types of groups or organizations from GitHub to GitLab.

Imported issues, merge requests, comments, and events have an Imported badge in GitLab. The namespace is a user or group in GitLab, such as gitlab.com/sidney-jones or gitlab.com/customer-success . Using the GitLab UI, the GitHub importer always imports from the github.com domain. If you are importing from a self-hosted GitHub Enterprise Server domain, use the import API GitHub endpoint with a GitLab access token with the api scope.

You can change the target namespace and target repository name before you import. For an overview of the import process, see how to migrate from GitHub to GitLab including actions . Estimating import duration Every import from GitHub is different, which affects the duration of imports you perform. However, in testing, GitLab imported https://github.com/kubernetes/kubernetes in 76 hours. Tests showed that the project comprised: 80,000 pull requests.

45,000 issues. Approximately 1.5 million comments. Prerequisites To import projects from GitHub, you must enable the GitHub import source . If that import source is not enabled, ask your GitLab administrator to enable it. The GitHub import source is enabled by default on GitLab.com. Permissions and roles To use the GitHub importer, you must have: Access to the source GitHub project The Maintainer or Owner role for the destination GitLab group Also, the organization the GitHub repository belongs to must not impose restrictions of a third-party application access policy on the GitLab instance you import to.

Known issues On GitLab Self-Managed and GitLab Dedicated, if your GitHub OAuth app uses expiring user access tokens (the GitHub default for new OAuth apps), importing several repositories at once can fail when imports run longer than eight hours. To prevent these failures, opt the OAuth app out of expiring tokens . GitHub pull request comments (known as diff notes in GitLab) created before 2017 are imported in separate threads.

This occurs because of a limitation of the GitHub API that doesn’t include in_reply_to_id for comments before 2017. In GitLab 18.3 and earlier , Markdown attachments from repositories on GitHub Enterprise Server instances are not imported. In GitLab 18.4 and later : Only video and image files in Markdown attachments are imported. Other file attachments are not imported. Because of a known issue , when importing projects that used GitHub auto-merge , the imported project in GitLab can have merge commits labeled unverified if the commit was signed with the GitHub internal GPG key.

GitLab can’t import GitHub Markdown image attachments that were uploaded to private repositories before 2023-05-09. If you encounter this problem and are willing to provide a sample repository, add a comment to issue 424046 and GitLab will contact you. For GitLab-specific references , GitLab uses the # character for issues and a ! character for merge requests. However, GitHub uses only the # character for both issues and pull requests.

When importing: Comment notes, GitLab only creates links to issues because GitLab can’t determine whether a reference points to an issue or a merge request. Issues or merge request descriptions, GitLab doesn’t create links for any references because their imported counterparts might not have been created on the destination yet. When importing from GitHub accounts with SAML single sign-on (SSO) enabled, Markdown attachments might fail to import.

This issue is caused by a GitHub API limitation where assets cannot be downloaded using a personal access token when SSO is enforced. To work around the issue, add the GitLab user performing the import as an outside collaborator to the GitHub repository. This permits access to private attachments during import. Import your GitHub repository into GitLab You can import your GitHub repository by either: Using GitHub OAuth Using a GitHub personal access token Using the API If importing from github.com you can use any method to import.

Self-hosted GitHub Enterprise Server customers must use the API. Use GitHub OAuth If you are importing to GitLab.com or to a GitLab Self-Managed that has GitHub OAuth configured , you can use GitHub OAuth to import your repository. This method has an advantage over using a personal access token (PAT) because the backend exchanges the access token with the appropriate permissions. In the upper-right corner, select Create new ( ) and New project/repository .

Select Import project and then GitHub . Select Connect with GitHub . Proceed to selecting which repositories to import . To use a different method to perform an import after previously performing these steps, sign out of your GitLab account and sign in again. Use a GitHub personal access token To import your GitHub repository using a GitHub personal access token: Generate a GitHub personal access token. Only classic personal access tokens are supported.

Go to https://github.com/settings/tokens/new . In the Note field, enter a token description. Select the repo scope. Optional. To import collaborators , or if your project has Git LFS files , select the read:org scope. Select Generate token . In the upper-right corner, select Create new ( ) and New project/repository . Select Import project and then GitHub . If Use a personal access token instead is shown, select it. Otherwise, the token field is already visible.

In the Personal access token field, paste the GitHub personal access token. Select Continue . Proceed to selecting which repositories to import . To use a different token to perform an import after previously performing these steps, sign out of your GitLab account and sign in again, or revoke the older token in GitHub. Use the API The import API can be used to import a GitHub repository. It has some advantages over using the GitLab UI: Can be used to import GitHub repositories that you do not own if they are public.

It can be used to import from a GitHub Enterprise Server that is self-hosted. Can be used to set the timeout_strategy option that is not available to the UI. The REST API is limited to authenticating with GitLab personal access tokens. To import your GitHub repository using the GitLab REST API: Generate a GitHub personal access token. Only classic personal access tokens are supported. Go to https://github.com/settings/tokens/new .

In the Note field, enter a token description. Select the repo scope. Optional. To import collaborators , or if your project has Git LFS files , select the read:org scope. Select Generate token . Use the import API to import your GitHub repository. Filter repositories list After you authorize access to your GitHub repositories, GitLab redirects you to the importer page and your GitHub repositories are listed. Use one of the following tabs to filter the list of repositories: Owner (default): Filter the list to the repositories that you are the owner of.

Collaborated : Filter the list to the repositories that you have contributed to. Organization : Filter the list to the repositories that belong to an organization you are a member of. When the Organization tab is selected, you can further narrow down your search by selecting an available GitHub organization from a dropdown list. Select additional items to import To make imports as fast as possible, the following items aren’t imported from GitHub by default: Markdown attachments from repository comments, release posts, issue descriptions, and pull request descriptions.

These can include images, text, or binary attachments. If not im

The rest of this page is on the live site.