> For the complete documentation index, see [llms.txt](https://docs-lunar.earthly.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-lunar.earthly.dev/install/git-platforms.md).

# Git Platforms

Lunar integrates with **GitHub** (github.com and GitHub Enterprise Server) and **GitLab** (gitlab.com and self-managed instances). One Hub can serve both at once, and each repository is routed by its host.

Most of Lunar works identically on either Git platform: components, domains, collectors, policies, catalogers, the SQL API, and the Grafana dashboards behave the same on both. The differences are concentrated in a few places, and this page is the summary — read it before planning an install so nothing on the list below is a surprise later.

Creating the credential is platform-specific, and lives on each platform's page:

* [**GitHub**](/install/git-platforms/github.md) — create the GitHub App the Hub authenticates as.
* [**GitLab**](/install/git-platforms/gitlab.md) — create the service account and its token, and set up the merge gate on Ultimate.

Everything after that is the ordinary install: [Self hosted](/install/lunar-hub/self-hosted.md) or [Dedicated](/install/lunar-hub/dedicated.md), each of which calls out the GitHub and GitLab variants inline where they diverge.

## Capability summary

| Capability                     | GitHub                                                                               | GitLab                                                                                                                                                |
| ------------------------------ | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Repository identity            | `github.com/org/repo`                                                                | `gitlab.com/group/project`, including nested subgroups                                                                                                |
| Credentials                    | [GitHub App](/install/git-platforms/github.md)                                       | [Service account token](/install/git-platforms/gitlab.md)                                                                                             |
| Webhook ingestion              | Push, pull request, workflow run                                                     | Push, merge request                                                                                                                                   |
| Webhook registration           | Automatic, per repository                                                            | Automatic, per project                                                                                                                                |
| Results on pull/merge requests | Check run + PR comment                                                               | Commit status (GitLab Free/Premium) or external status check (GitLab Ultimate) + MR comment                                                           |
| Results on the default branch  | Check run + Grafana dashboards                                                       | Commit status + Grafana dashboards; project badges                                                                                                    |
| Merge gating                   | Mark Lunar's check required in branch protection                                     | [Provisioned automatically on Ultimate](/install/git-platforms/gitlab.md#merge-gate); on Free and Premium, enable **Pipelines must succeed** yourself |
| Config sync                    | [GitHub Action](/install/lunar-hub/self-hosted/sync-config.md#github-actions) or CLI | [`.gitlab-ci.yml` job](/install/lunar-hub/self-hosted/sync-config.md#gitlab-ci) running the CLI                                                       |

Which CI systems Lunar traces is a separate question from which Git platform you are on — see [Lunar CI Tracer](/install/ci-tracer.md).

## What the differences mean in practice

### Merge gating depends on your GitLab tier

On GitHub, Lunar posts a check run and you decide whether to make it required in branch protection.

On GitLab **Ultimate**, Lunar blocks merge requests whose gating policies do not pass, and provisions the necessary project settings itself — see the [merge gate](/install/git-platforms/gitlab.md#merge-gate) for what it changes and how to override a block.

On GitLab **Free** and **Premium**, Lunar posts a commit status instead. That can still gate merges, but you turn it on per project with **Pipelines must succeed**, and it gates on the whole pipeline rather than on Lunar as a named requirement. There is also no comment-driven bypass on these tiers.

### Self-managed hosts must be configured

GitHub Enterprise Server and self-managed GitLab are both supported, but a self-managed GitLab host is only recognized as GitLab if you list it in your credentials configuration. See [GitLab](/install/git-platforms/gitlab.md).

## Running GitHub and GitLab together

One Hub can serve both. Configure the GitHub App as usual and add `HUB_GITLAB_TOKENS` alongside it; each repository is routed by its host. Neither platform is mandatory to the Hub, which starts as long as at least one is configured.

The Helm chart has not caught up on that last point: its template guard still requires the GitHub App values, so a self-hosted chart install carries a GitHub App configuration even when every component lives on GitLab. See [install Step 4](/install/lunar-hub/self-hosted/install-walkthrough.md#git-platform-credentials); dedicated `hub.gitlab.*` values are planned.

## Next steps

* [GitHub](/install/git-platforms/github.md) — GitHub App setup.
* [GitLab](/install/git-platforms/gitlab.md) — token setup, Hub configuration, and the merge gate.

Then carry the credential into your install:

* [Self hosted](/install/lunar-hub/self-hosted.md) — [Prerequisites](/install/lunar-hub/self-hosted/prerequisites.md) and the [install walkthrough](/install/lunar-hub/self-hosted/install-walkthrough.md).
* [Dedicated](/install/lunar-hub/dedicated.md) — Earthly configures the Hub; you [deposit the credential](/install/lunar-hub/dedicated/setup.md#step-4-deposit-your-secrets) into your install.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-lunar.earthly.dev/install/git-platforms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
