Configuring Git for version control is a key step in creating a new LookML project. Typically, each project should have its own repository — however, what if you need to configure a project with a git repository that contains existing LookML? This need may arise in the following situations:
- When you're moving an existing LookML project between instances
- When you're resurrecting the code from a broken or defunct LookML project in a new project
This article addresses best practices for configuring a new LookML project with an existing, non-empty git repository for further LookML development.
The steps below follow the instructions outlined on the documentation page for Setting Up and Testing a Git Connection — specifically, the section on Connecting to Git Using SSH. If you prefer to connect using HTTPs, see the section on Connecting to Git Using HTTPs.
This workflow is only for repositories to which you have write access.
- To create the new LookML project, you must be in Development Mode. From the Develop menu, click Manage LookML Projects:
- Click New LookML Project:
- To the right of Project Name, add a name for your project. To the right of Starting Point, select Blank Project. Once you have configured these settings, click Create Project:
A blank project is the starting point because it will be populated with LookML objects from an existing repository, rather than from a database schema or SQL query.
Starting in Looker 7.12, the following actions are accessible from the Configuration tab of the Project Settings page in the new IDE.
- On the new LookML project page, click Configure Git:
- When prompted, enter the repository URL:
- Add the deploy key from Looker to your repository, according to your repository host protocol.
- Finalize and test the configuration.
Starting in Looker 7.12, the following actions are accessible from the Git Actions menu and the Merge & Deploy to Prod button in the new IDE. Select the Git icon from the navigation bar to navigate to the Git Actions menu.
- After configuration, Looker will prompt you to deploy to production:
- Hold the Shift key while clicking the git menu to view the shift-click git menu, and select Pull from Production.
- Finally, click Deploy to Production.
If there is a public repository you would like to use as the basis of a blank LookML project but you do not have write access to the repository, follow the instructions outlined in the Cloning a Public Git Repository section of the Creating a New LookML Project documentation page.
Any new changes to the LookML will not affect the original repository; rather, the changes will be saved in your local version of the repository.
If you are setting up a git workflow using one repository across multiple instances, see the Git Workflow Using One Repository Across Multiple Instances ‐ Development, Staging, and Production Help Center article for additional information.