Syncing to Gitlab
You can sync your Modelbit git repo to a repo in your company's Gitlab account. This is especially valuable for using your Gitlab-based code review, CI/CD and Pull Request workflows on your Modelbit deployments.
This workflow requires you to have admin permissions within your Gitlab account.
You should create a new, empty git repository for Modelbit.
Adding your Gitlab repo URL to Modelbit
First, make a new Gitlab repo inside your Gitlab account.
Once created, from the main page of your Gitlab repo, click the blue
Clone button and copy out the URL. The URL will look like
Head back to Modelbit:
Settings, open the
- Click the
Gitlabbutton, then click
- Paste in the URL of your GitHub repo and click
Before heading back to Gitlab, copy the
Deploy Key. 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.
Adding your Modelbit deploy key to Gitlab
Open your repo in Gitlab, then:
- On the left hand side, hover over
- Click the "Expand" button next to
- Paste in the Modelbit deploy key in the
Keyfield. Give the key a memorable title, like "Modelbit Integration".
Make sure to check "Grant write permissions to this key". Click
You must check the
Grant write permissions to this key box in order for Modelbit to push changes to this repository.
Head back to Modelbit, click
Next, and Modelbit will test the connection to Gitlab. If the Deploy Key has been set with write access and no branch protection rules prevent Modelbit from syncing with the repo, you're all set.
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!
Do not use
git clone with this repository, use
modelbit clone. The
modelbit clone command will
git clone your repo and configure it to handle binary files like
To ensure the quickest sync between Gitlab and Modelbit, configure Gitlab to notify Modelbit of changes using GitHub webhooks.
You'll find Modelbit's Webhook URL and Secret in the Git Settings page.
In Gitlab, go to your repository's settings area and:
- Paste Modelbit's
Webhook URLinto the
- Paste Modelbit's
Webhook Secretinto the
- Check the
Push eventsbox under
The next time you push changes to Gitlab, Modelbit will be notified and immediately sync the changes.