Open navClose nav

GitLab

Disclaimer

This guide assumes you already have an existing GitLab account and repository with a Jekyll or Hugo project. If you don’t have an existing project, check out our Quick start guide, which contains guides and resources for building your first static site.

Forestry’s allows you to import your static site through public and private GitLab repositories. This allows Forestry to sync any changes made by editors in Forestry to be comitted back to GitLab. This also allows developers to work on your website on their local machine, and have all changes by synced back to Forestry.

Importing from GitLab

To import a site with GitLab, login to Forestry and follow these instructions:

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2019/07/select-generator.png

From the dashboard, click “Add Site”. In the modal that opens, choose Choose the static site generator your site is built with from the dropdown menu, and then press “Next”.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2019/07/select-provider.png

Now, choose “GitLab” from the list of options.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/01/4.png

This will redirect you to GitLab, and prompt you to enter your login credentials if you are not already logged in.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/01/5.png

Give Forestry access to your GitLab repositories by clicking “Authorize”. You can also request access to any GitLab Groups you are a member of.

In order to import a site from GitLab, you will need maintainer or owner permissions for the repository. This is because Forestry needs to add a webhook to your repository in order to watch for changes.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/04/add-site-flow-choose-repo-not-github.png

Once authorized, you will be redirected back to Forestry to choose the repository you wish to import. Use manual setup if you need to access private repositories.

From the dropdown, choose your repository and the branch you would like to import, and then press “Next”.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/04/add-site-flow-config-file.png

If Forestry can’t locate your site’s config file inside of the root of your project, you’ll be prompted to provide the directory it is located in.

When you’re done click on “Import Site” and let us get your site ready.

To invite collaborators to edit content on your project, see user roles.

Importing from GitLab Groups

If you are trying to import a repository from a GitLab Group you are a member of, you will need maintainer permissions on the actual repository you are trying to import.

Applying maintainer permissions to a group does not effect its members when importing. Members must be given maintainer access on a per-repository basis.

Last updated on April 6, 2017