Skip to main content

Syncing to Gitlab

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

Adding your Gitlab repo URL to Modelbit

First, make a new Gitlab repo inside your Gitlab account. While Modelbit may work with any repo, it is strongly recommended to create a blank one for Modelbit to avoid conflicts with other tools and systems.

Once created, 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!