Connect to GitHub/GitLab
Introduction
By default, your analytics code in Holistics is kept in an internal Git repository that Holistics maintains. In case you want to have more granular control of your code base, you can easily connect your Holistics account with an external repository in GitHub or GitLab.
Benefits of using an external repository:
- You have direct access to a backup version of your analytics code.
- You can apply proper data governance and quality control protocols by enforcing a code review process before someone clicks Deploy to production.
- You can leverage your own local editor (i.e. VS Code) to manage Holistics modeling layer and push changes back to Holistics conveniently.
How to connect to your external Git repository
Ensure that your external Git repository is a bare repository. It must not have any commits, or contain any default files like README.md
, LICENSE.md
, etc.
Create an empty Git repository (without a README) on GitHub, GitLab or any Git-based version control platform of choice.
If you use Github to initialize a new repository
When initializing a new repository in Github, be careful not to select the options to generate default files.
Navigate to the Version Control Settings page.
Get the SSH URL for the external Git repository.
Paste the SSH URL into the “SSH URL” field on the Version Control Settings page.
Copy the Deploy Key which Holistics provides on the Version Control Settings page and paste it into the Settings for the repository:
Make sure to select the Allow write access option because Holistics requires this setting to make and deploy changes.
Navigate back to the Version Control Settings page and click Test connection.
Once the connection is successfully established, a new
master
branch will appear in the repository, along with a set of folders, one for each object type that is synced. Holistics will then sync with themaster
branch in the repository as the Production branch.
Notes:
- Any changes made in Holistics will be synced to the external repository at the corresponding branches
- Any changes merged into the
master
branch in the external repository will be reflected in the Holistics. However, it will not affect your production directly. You will need to pull changes from the master branch and merge to your current branch in Holistics. After that, you can click Deploy to production.
To make full use of your new setup with an external Git repository, you can take an extra step and enforce a pull request & code review process.
You should not modify the commit history (for e.g., force push) via GitHub or GitLab since it could cause unexpected behavior in Holistics as our "git syncing actions" depend on the commit history.