Skip to main content Link Menu Expand (external link) Left Arrow Right Arrow Document Search Copy Copied

Introduction

GitHub and GitLab are web-based repository management services that provide an extensive suite of code management features and enable sharing local file changes with a remote repository using the Git version control system. Given the similarities between these two repository management services, developers may find it challenging to select the right one for their project. Choosing the right repository management service depends on the scope of your project, the size of your team and the resources available to that team. In this learning module, we will explore the key differences between GitHub and GitLab to help developers choose the right repository management service for their team.

If you are not already with the Git version control system, we recommend consulting the Introduction to Git and GitHub (ubc-library-rc.github.io) workshop provided by the UBC Library Research Commons.

GitHub

GitHub is a web-based repository management solution founded on Git, an open-source code management system. GitHub allows software developers to create and manage public repositories for free, but it charges for private repositories and offers a variety of paid plans. A GitHub repository contains all the files of a project as well as their revision history, which allows developers to easily modify, collaborate, and merge their code. A repository can have multiple collaborators working simultaneously on a project. GitHub provides a vast array of functions to help developers manage their code base. The most popular GitHub functions and their uses are listed below:

  • Fork: forking allows a developer to create a copy of an existing repository and modify it without affecting the original code base. Forking allows developers to extend existing publicly available repositories by improving the code or augmenting the software with additional features.
  • Pull Request: a pull request is created whenever a developer wants to merge their changes back into the main branch of the project they are working or into another existing branch. Pull requests are an integral part of software development and enable developers to simultaneously work on different aspects of their project. A pull request created by one developer is often reviewed by one or more other developers on the team prior to merging it.
  • Merge: Developers can merge changes from one branch into another. Merging is often done after reviewing a pull request or to bring an existing branch up to update with the main branch.
  • Push: The push functionality is used when a developer wants to send code from their local repository to a remote repository. Push allows developers to save changes made locally by sending them to a remote repository. The changes can then be retrieved when needed.
  • Commit: A commit is a snapshot of a repository. It includes the changes made to one or more files in the repo and allows the developer to switch back to the that specific code revision if they need to inspect the code at that time or revert changes. Each commit is assigned a unique ID that lets collaborators keep a record of their work.
  • Clone: A clone is local copy of a remote repository.

GitHub was acquired by Microsoft in 2018. GitHub is often used to host open-source projects, but the software GitHub’s service is based on is closed source. While GitHub can be integrated with additional DevOps tools, it does not offer an extensive suite of DevOps features out of the box, and thus requires additional configuration to allow it to function as a complete DevOps platform.

GitLab

GitLab is an open-source web-based repository management system used to host public and private repositories. GitLab offers developers a complete DevOps platform that allows them to successfully manage every aspect of their project from planning to source code management, performance monitoring, and quality and security assessment.

GitLab is also built on top of the Git open-source version control system and provides many of the same functionalities offered by GitHub and detailed above. Merge Requests are GitLab’s version of pull requests and work essentially in the same manner by allowing developers to create a request containing changes to the code base that will be reviewed by another developer prior to being merged into the main branch.

GitLab’s main selling point is ability to act as a complete DevOps platform without needing additional third-party plugins, thus making it an ideal choice for teams looking for a single software solution to carry their project from the planning phase to the deployment phase.

Comparison

Both GitHub and GitLab provide excellent solutions for code management and version control. However, there are some considerable differences between these two platforms that may cause a team of developers to opt for one platform over the other. In this section, we will provide a detailed comparison of GitHub and GitLab in 7 key areas.