“A bright future for GitHub” – Chris Wanstrath (@defunkt) (CEO & Co-Founder, GitHub)
The community is divided on the repurcussions of Microsoft’s acquisition of GitHub and GitLab is taking advantage of this to broaden their customer base. Here is a graph as of June 7th depicting the number of GitHub imports:
Going by those stats, you might want to at least try out GitLab (if you haven’t already decided against it). But you want your precious issues, pull requests, wikis, labels, descriptions and so on to also be seamlessly moved to GitLab. This post aims to help you do exactly that.
The primitive way of importing into GitLab would be to clone all your GitHub repositories to your local system, create empty repos on GitLab, add those repositories as a new remote and push it all there. But we don’t want to do all that stuff. Thankfully, GitLab provides an easy way to do this using their GitHub Importer.
You can use a GitHub personal access token to import your repositories into GitLab 1. Navigate to GitHub generate tokens 2. Enter the relevant details of your token 3. Choose the repository scope: these define the access for the token, see this for more info 4. Now generate the token and copy the hash into the GitHub Importer 5. Now the GitHub Importer lists your repositories (based on your scope) and prompts you to import all or import individually. 6. You can also choose where in GitLab to import your repository into a specific namespace. For example, if you are importing the repositories of a GitHub organisation, you can create a group on GitLab and import the repositories under that namespace.
You can also use the existing integration between the two services to import your repositories. Ensure that any GitHub users you want to map to GitLab users have accounts that are linked or a public email address that matches. 1. Navigate to the GitHub Importer 2. Click on List your GitHub repositories which will redirect to GitHub to authenticate the GitLab’s access to your repositories. 3. Again if you want your organisation to be imported, ensure that your org is checked in the GitHub authentication page. 4. Now go ahead with the steps to import as described above.
GitLab will do a very good job with creating and using namespaces to import. For instance, the importer creates any new namespaces if they do not exist, or, if the namespace is taken, the repository is imported under the namespace of the user who initiated the import process. And you can configure almost everything about this.
GitHub and GitLab differ in some nomenclature and that can rise to confusion. For instance, a project in GitLab is a repository on GitHub. But GitHub has their own idea of projects which are sets of cards to highlight the work to be done in a repository.
Owing to this fact some things cannot be imported into GitLab. The following aspects of a project are imported:
- Repository description (GitLab.com & 7.7+)
- Git repository data (GitLab.com & 7.7+)
- Issues (GitLab.com & 7.7+)
- Pull requests (GitLab.com & 8.4+)
- Wiki pages (GitLab.com & 8.4+)
- Milestones (GitLab.com & 8.7+)
- Labels (GitLab.com & 8.7+)
- Release note descriptions (GitLab.com & 8.12+)
- Pull request review comments (GitLab.com & 10.2+)
- Regular issue and pull request comments
The other aspects like stars, forks, organisation teams, etc cannot be imported. For a detailed description browse the developer docs of the Github Importer
Reposted from my personal blog