# GitLab

### Add Git connection

To add GitLab personal Git token in Brainboard, you first need to generate it in your GitLab account.

<details>

<summary>Steps to generate a personal Git token on your GitLab account.</summary>

1. Go to your GitLab[ personal tokens page](https://gitlab.com/-/profile/personal_access_tokens).
2. Add a name and specify `API` rights, then click on `Create personal access token` button:<br>

   <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FTtJaTGFd1ET7a9PDNlWp%2Fimage.png?alt=media&#x26;token=eaa4238d-6022-4d4e-9559-2ac2669bbcf7" alt=""><figcaption></figcaption></figure>
3. The token is generated, you can copy it to add to Brainboard:<br>

   <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2F1v1U0t2x5R0GXW5JdxpS%2Fimage.png?alt=media&#x26;token=024cfe7c-03f8-4825-9e1f-a825ad63792a" alt=""><figcaption></figcaption></figure>

</details>

To add the generated token in Brainboard:

1. Go to the [Git integration](https://app.brainboard.co/settings/integrations/git) settings page.
2. Click on `Integrations`
3. In the section `Personal connections` Click on `Add connection`&#x20;
4. Select `GitLab` tab<br>

   <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FdSIh3jAX6Tsde7i9OSdg%2FCleanShot%202025-04-11%20at%2017.37.53%402x.png?alt=media&#x26;token=a413cc74-3ae3-421a-b26c-aaff63b75b59" alt=""><figcaption></figcaption></figure>
5. Add your credentials in the displayed window:
   * Name of the token. This is only for Brainboard, it will not be used when you do a pull request.
   * The URL of your GitLab server: by default Brainboard uses `https://gitlab.com`, but if you have a private Gitlab instance accessible through the internet or if you use a single-tenant Brainboard offering, you can specify a different URL.
6. Then click on `Save and close` button.
7. Brainboard will verify if the credentials are valid:
   1. If they are valid, Brainboard displays a success message and you can see the integration now in the Git connection page<br>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fpra8KE7gQGR5DC2nb3nn%2FCleanShot%202025-04-11%20at%2017.07.55%402x.png?alt=media&#x26;token=7628f78c-bf93-4f36-a57b-45f561a58ad6" alt=""><figcaption></figcaption></figure>
   2. If they are not, you'll receive an error about what is wrong. For example:<br>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fdv9hKKZaTDhRnJqibfML%2FCleanShot%202025-04-11%20at%2017.00.18%402x.png?alt=media&#x26;token=48bcd08a-1c9d-4464-abdb-b425d22e4f0d" alt=""><figcaption></figcaption></figure>

      <figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2Fqnr5EInAOYsKxrKSgPNJ%2FCleanShot%202025-04-11%20at%2017.03.42%402x.png?alt=media&#x26;token=80ab95d5-8278-4f87-8183-e778449c6a4c" alt=""><figcaption></figcaption></figure>

### How to use

Please refer to the page [pull-requests](https://docs.brainboard.co/settings/integrations/git-configuration/pull-requests "mention") to understand how you can use your git connections whether you want to do a pull request and import your code from Git.

### Edit or delete connection

1. Go to the [Git integration](https://app.brainboard.co/settings/integrations/git) settings page.
2. Click on `Integrations`
3. In the section `Personal connections` Click on `GitLab` integration that you want to edit or delete
4. Select the action you want to perform from the view

<figure><img src="https://2733077811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7YhVIZuz5Brv8kisTlFL%2Fuploads%2FRAR2RaX8VQLJW1X0ciC9%2FCleanShot%202025-04-11%20at%2017.43.15%402x.png?alt=media&#x26;token=ec1357f4-80cf-4eda-bf0c-0aa5516a8137" alt=""><figcaption></figcaption></figure>
