# How to Connect Teamscale to GitLab
Teamscale integrates with GitLab using the available API and web hooks. No global configuration is required. To connect a project to code from a GitLab project, follow these steps:
Ensure that the Teamscale instance base URL is configured correctly.
Select the GitLab connector during project creation.
Select or create an account for the GitLab server. The account's URL should point to the GitLab server's root URL (i.e., it is not project specific). The username can be empty (ignored). The password is a personal access token of a GitLab user with api scope. To obtain a personal access token in GitLab, navigate to your user's settings page and select the Access Tokens page.
Complete project creation as usual, by providing the name of the GitLab project (e.g.,
my-user/my-project) and completing any other required fields. As the first step in project creation, Teamscale will register its web hook with the project. After this, Teamscale will automatically be informed about events in the project, such as pushes to the repository and changes to any merge requests.
# Manual Creation of Webhooks
In case the technical user does not have at least a Maintainer role, you will need to manually create and configure webhooks in the GitLab repository.
- Open the GitLab repository you want to add the webhook to.
- From Settings, click Webhooks.
- Configure the webhook as follows:
- URL: Enter the URL of Teamscale's GitLab endpoint.
It should be in the following format:
- Trigger: Select the following triggers:
- Push events
- Merge request events
- URL: Enter the URL of Teamscale's GitLab endpoint. It should be in the following format:
- Click Add webhook.
If there are restrictions, so that Teamscale cannot receive GitLab web hooks or web hooks cannot be automatically created, please apply these advanced configuration options.