OSF GuidesAdd-ons Storage add-onsConnect GitLab to a Project

Connect GitLab to a Project

GitLab is an open-source web-based git repository manager. You can link one repository per project. Different repositories can be linked to different components within the same project. The connection with GitLab is read-only, which means files added to your GitLab repository will be viewable - but not editable - via the OSF.

The GitLab add-on allows you to connect external content to OSF. This connection does not store or back up this content on OSF. To back up your content to OSF Storage, consider registering your project.

1. Enable GitLab in your project

First, open your project, then click the Add-ons tab in the navigation bar.

You will be taken to the "Add-ons" page for the project.

In the list of add-ons, click the Enable link next to GitLab.

The GitLab terms will appear.

Read the terms, then click the Confirm button.

2. Configure GitLab

Find GitLab in the "Configure Add-ons" section, then click the Connect Account link.

The "Connect a GitLab Account" modal will appear.

Select a GitLab repository from the menu, then enter an access token. When you generate an access token, include "api" in the list of scopes.

Then click Save to connect your GitLab account to your project.

The "Import GitLab Account" modal will appear.

Click Import.

3. Select a repository

Having trouble viewing your GitLab projects? You may have left out the api scope when you generated your personal access token. If you experience this issue, you will need to reauthorize your GitLab connection via your global add-on settings and generate a new access token, selecting api from the list of scopes. See Configure GitLab.

Next, select a repository from the menu, then click Save.

GitLab will be connected to your project.

4. View branches

To switch to different branches, select the root folder from the file tree.

The "Branch" menu will appear in the toolbar. Click inside the menu to select a different branch to view.