Skip to main content

Syncing to Gitlab

You can sync your Modelbit git repo to any Gitlab repo, including your company's Gitlab repo. This is especially valuable for using your Gitlab-based code review, CI/CD and Merge Request workflows on your Modelbit deployments.

Adding your Gitlab repo URL to Modelbit

First, copy the URL of your Gitlab repo. If you're unsure which Gitlab repo to use, it may make sense to create a blank one for Modelbit.

From the main page of your Gitlab repo, click the blue "Clone" button and copy out the URL.

In Modelbit, in the "Git branches" page of "Settings", click "Add Git Remote" in the "Remote Git Repository" section of the page. Paste the URL of the Gitlab repo.

Copy the key deploy key out of the dialogue. This deploy key is Modelbit's public key for pushing and pulling your Git repo, just like a user's public key. It is not a secret. Click "Connect Remote".

Adding your Modelbit deploy key to Gitlab

In GitLab, on the left hand side, hover over "Settings" and click "Repository". Click the "Expand" button next to "Deploy Keys".

Paste in the Modelbit deploy key in the "Key" field. Give the key a memorable "Title", like "Modelbit Integration". Make sure to check "Grant write permissions to this key". Click "Add Key".

Now Modelbit will sync to your Gitlab repo, allowing you to use Gitlab Merge Requests for merges, and all your Gitlab-based tools for CI/CD, code review and more!