GitLab vs. GitHub 2020

I use GitLab and GitHub over the last few years. I use GitLab CE (self hosted) at work exclusively and also use GitLab.com (SaaS version of GitLab) for 99% of my personal projects including this blog. I use GitHub for most open source stuff including my VSCode extension Qt tools. So I use always the free editions of the products and so my comparison will be focused mostly on that stuff. And also be aware that I use GitLab nearly daily so the comparison could be a little bit biased.

GitLab announced on Apr 14, 2020 the #GitChallenge and encourage people to write a comparison post between GitLab and GitHub. After watching the GitHub Satellite event I feeled ready to do that ๐Ÿ˜‰.

Short history lesson

GitHub

GitHub

GitHub was launched in 2008. Git is used as the SCM behind it as the name suggests. They make it really easy to make changes to a repository through forks without asking the original author for write permissions and give it back to the the original (if wanted) via a pull request. Pull request make it easy to review changes before merging back changes and so GitHub get more popular over time. GitHub was acquired by Microsoft back in 2018 and now has its new CEO, Nat Friedman.

GitLab

GitLab was launch ~2014. It also use git as the SCM. GitLab has also more or less the same contribution model as GitHub. You can also make forks, if you have no write permission, and you can contribute back via a merge request. Merge request also make it easy to make code review before merging back changes. Gitlab acquired some companies over the time f.e. Gitter and Gitorious. GitLab’s CEO is Sytse “Sid” Sijbrandij and the CTO is Dmitriy Zaporozhets.

Open Source

GitHub has most of the open source software and for a really long time your were “not really open source” when it could not be found on GitHub. This changed with GitLab a little bit which has also some popular open source projects but the majority of the projects are on GitHub until today. But it depends on how you count it. Because of the selfhost option of GitLab some really prominent open source projects have their own public instances like f.e. kitware which is known for cmake and GNOME. Maybe gitlab.com will add an option in the future that selfhost public instance can be visible (opt-in for instance owner) in the search/explore section.

Closed Source

This is hard to compare, but if you search how many big companies use GitLab you can assume that are many projects which are not public visible. There are multiple reasons for that f.e. when you don’t trust(or not allowed to trust) another party (GitLab/GitHub) to keep your stuff safe and need to host their own instance. Here is where GitLab shines and I assume that a big part of their revenue come from this fact. GitHub had also the option to host “local” instances and it was so popular that it was discontinued on October 16, 2019.

Github.com and GitLab.com both provide the option to keep your repos private, but only GitLab.com has offered this option for free since its launch. GitHub announced on Apr 14, 2020 that also GitHub.com offer free private repos.

Transparency

GitLab is an extremely transparent company. I don’t know that many companies were you can see 95% of the companies internals in the public. They have all their products open source on GitLab.com (including the Enterprise edition) and also their handbook and more stuff. They are also transparent in the “bad” times, as you can see here when their GitLab.com CI system was extremely slow or here when they accidentally delete their production database.

GitHub on the other hand is a typical company, which some blog post and announcements but I think they will never reach the level of transparency of GitLab. And one thing is also very strange about GitHub, they host millions of open source repos but GitHub itself is, as far as I know, not open source!

CI/CD

GitLab has an awesome CI system called GitLab CI. It’s built in for some years now and it works really great and is definitely my number one CI system on the market. You can use shared runners on GitLab.com (free tier has 2000 minutes, which is a lot for normal free use, but you can buy more if you need) but you can also add your own CI machines to GitLab.com(!) when have special requirements like f.e. a graphics card or need much more speedy machine then the shared ones. GitLab CI can use f.e. shell with a bare metal server, which include bash on linux and powershell on windows. You can (or should) also use docker on linux as on windows which makes it extremely easy because you can use your own docker registry to deploy the tools you need for for CI build so easily. CI pipelines can be reused by including stuff from the same repo, another repo on the same instance or a completely different server which is awesome.

GitHub has built in CI via GitHub actions for some months now. Before you have the option to use Travis, AppVeyor (windows only), GitLab CI(!) and azure pipelines via the market place. The 3rdparty systems were great but there were always the “pain” of setup them up separated. Since GitHub Actions that changed on GitHub. Its an fork of azure pipelines and if you ever used azure pipelines you will see the similarities. GitHub actions make it easy to add CI for all major OS with some yaml files like GitLab CI. They also add the possibility to share CI code via the marketplace to reuse CI pipeline code.

issue board

UI/UX

I like the GitLab UI. For me it has a better UI then GitHub, but that’s absolutely subjective. GitHub’s landing page has sometimes really to much information for me, I would like to be able to turn f.e. the explorer page of or make it configurable to my preferences. I really like the issue tracker from GitLab and like the epics (tested via trial version). The commit graph (network) in GitHub is something I totally dont like, because it is so hard to read. On the other hand GitLab’s repo graph is awesome, super easy to read and extremely useful. I also like the merge request view much more the GitHub’s pull request, because you can do more and you can always switch to the WebIDE.

Planning

The GitLab issue tracker and all stuff in the GitLab planning stage are awesome. I really like their planning system and the ability to link everything with everything. If you used it for a time it is really hard to switch to another system. I also use it for any kind of issue tracking, not only for coding stuff.

issue board

GitHub planning system also work, but the UI/UX is not that great as the GitLab one.

Release cycle

GitLab release a new minor version every month (on 22th), which is a awesome strategy. You can decide if you want to be the early adopter (upgrade on 22th) or the late adopter (upgrade on 21th). This model is great and I adopt this in my own bigger projects at work. You get always incremental changes every month from GitLab so it never feel stuck in development.

GitHub on the other hand has no fixed update strategy as far as I can tell, but it’s SaaS only it does not matter that much.

GitLab pages vs. GitHub pages

Here I personally prefer GitLab pages because it is so straightforward to do. I only need a GitLab CI job named pages and store my html artifact in the public folder. I mostly use hugo with GitLab pages, but you can use any tool which can generate html files or you just write html code directly and deploy that.

GitHub pages seems also really good, but it’s prefered way is Jekyll which is not my favorite, but GitHub pages will also do that job.

API

Both have a REST API as well as a GraphQL API. I use the GitLab REST really often and really enjoy it. You can build many things with it like f.e. bots. This APIs can be used anywhere like f.e. directly in a GitLab CI job, a local script or an service.

For me both products are equal here.

Marketplace

One thing which is great at GitHub is GitHub apps. You can extend your repo with many thing like f.e. bots and it is not that hard to write your own. This is something I really miss at GitLab. Technically everything is there but it is not so easy to integrate like a GitHub App.

GitLab has a special challenge here. For gitlab.com it should be straightforward to build that in, but I would love to see also an solution for self hosted instance.

Web IDE

Both products have a Web IDE where you can change files directly in the browser. Both work really great.

GitHub also announced codespaces which add the possibility to open a project directly in VSCode in the browser which is really nice. For now these option is in early access and after that you have to pay for it. I think this would be great but this also have its downsides like when you need local GUI like desktop or smartphone. But for documentations it could be really good.

VS Code

You can use GitLab directly from VS Code through the extension GitLab Workflow. Here you just need set your GitLab Personal Access Token and you have access to your repos directly from GitLab. You can also lint your .gitlab-ci.yml file directly from VS Code.

GitHub has a deep integration for GitHub, because both are owned by Microsoft. You can review pull requests directly in VS Code and you can also write comments.

Conclusion

I personally prefer GitLab. I like there UI/UX and there CI system is the best on the market. I also like there openness (checkout their YouTube channel) and that GitLab itself is an Open Source product where you can see everything in the issue tracker and you can contribute code as well ๐ŸŽ‰. The only really “downside” for me is that gitlab.com don’t offer shared runners for mac (windows is in beta, but works really well) which sometimes force me to use GitHub.

GitHub is a great platform and most off the open source software lives there.

So if you have to decide which system you should use you can use GitLab as well as GitHub because both are great platforms.

If you ask me, I would recommend GitLab over GitHub.