Babbles by Michael

Gitlab vs Github, and Git

If you ask anyone or anything about a git hosting platform to use, Gitlab and Github will consistently show up across all of your answers. In truth, the answer is always “it depends” (as with everything in software development). I've been using both for a while so we'd try seeing when/why to use one. Or both.

What exactly is Git?

Git, not to be confused with either Github or Gitlab is a system that:

  • helps you track and manage your source code.
  • maintains a log of how each file (thus, the overall application) changes over time
  • does 1 and 2 above in a distributed manner i.e, there is no single point of failure as each developer's copy of the code is essentially a backup.

Once you see how important git is, you begin to see how important having your git repository outside of your local machine is. And of the biggest two platforms that provide such services are Github and Gitlab

Code Management

At its core, the purpose of a git hosting platform is well, to manage git repositories. And they both do an excellent job of that. More than just being a mirror of your local repository, they both provide the ability to:

  • manage Issues (so other developers and users can suggest new features, or talk about bugs in the existing source code).
  • submit Merge/Pull requests (This is how new code is added to the repository and it comes with a nice user interface to discuss every change in detail).
  • protect your source code from authorized changes

Project Management

If you're looking to organize and prioritize tasks across your project, both platforms provide just that. Github has Project Boards and Gitlab offers Issue Boards. They both work similarly and syncs with the issues and merge/pull requests being opened and closed in the project.

CI/CD

Both platforms provide continuous integration servers that help you deploy your code to its final users as quickly as possible. Gitlab has Gitlab CI/CD and Github has Github Actions. On the surface, they both have some of the features you'd expect from a CI/CD platform such as:

  • build pipelines (and how your code goes from commit to deployment).
  • status reports (to help you know if the last update broke the build)
  • third-party integrations, etc.

Gitlab's CI/CD especially shines here as it lets you use your servers to build (see Gitlab Runners), as well as provide an easy-to-use configuration via AutoDevops. Fun Fact: Both platforms offer around 2000 minutes/month of CI time (though Gitlab allows you to buy more minutes without upgrading your plan).

Community

A big part of using a platform is the community around it, which translates to how easy it is to get help online and offline when you run into issues. While both platforms have excellent documentation online to help you out, there are more tutorials and resources geared towards Github and thus, more people using it. Bandwagon effect.

Misc

Beyond the surface though, each platform offers a suite of features that differentiate it from the other. One of my favorites is Repository Mirroring which automatically updates an external repository when you push to Gitlab.

For a detailed overview of features (and how much it costs to get them, you can look up Github's pricing page and Gitlab's pricing page).

Verdict

I use Github for open source projects that “look good for the resume” because of the community there and use Gitlab for side projects, class assignments and freelance projects that require collaboration.

In the end, the best platform to use is…well, that still depends on your use case and the features that are most dear to you.