Connecting Looker to Git
LookML projects are version-controlled using Git, which allows LookML developers to track changes, collaborate on the project, see the history, revert to previous versions, and configure CI/CD.
Getting ready
Make sure you are on your LookML project (Figure 1.24). To get to your LookML environment, you can click on the menu on the left (the Explore, Develop, and Admin tabs), then click on Develop and choose your project (test_project
in our case).
How to do it...
The steps for this recipe are as follows:
- On your LookML page, click on Configure Git in the upper right-hand corner of the page (almost any Git provider will work, including GitHub, GitLab, and Bitbucket).
Figure 1.25 – Configure Git
- If you don’t yet have a Git repository where you want your LookML project to live, you can click on Set up a bare repository instead (Figure 1.25).
Important note
For secure and reliable version control, consider using your own Git repository hosted outside of your Looker server. This ensures that your LookML code and its history are safe, even if something happens to the Looker instance or server.
- On the Configure Bare Git Repository page, click on Create Repository.
- After clicking on Create Repository, click on Back to project.
How it works...
Once your LookML project is connected to Git, you can start tracking changes to your files. Any changes you make will be saved to your local Git branch. When you are ready to share your changes with other developers, you can push your branch to the remote repository.
Other developers can then pull your changes to their local branches and merge them into their own work. If there are any conflicts, Git will help you to resolve them.
When you are ready to deploy your changes to production, you can merge your development branch into the production branch. Looker will then automatically deploy the latest changes to your production environment.
There’s more...
You can use your existing Git repository for Looker. For this, provide your repository URL on the Configure Git page (Figure 1.25). You can create a new repository on one of the supported Git platforms: GitHub, GitLab, Bitbucket, Phabricator Diffusion and others.
On the Configure Git page (Figure 1.25), there are links to the instructions on how to create your repository in any of the listed Git platforms.