DataLab Docs
  • What is DataLab?
  • Work
    • Creating a workbook
    • Sharing a workbook
    • Managing a workbook
    • Code cell
      • Working with packages
    • Text cell
      • Including images
    • SQL cell
      • SQL scenarios
      • Parameterize your SQL query
    • Explore Data cell
    • Chart cell
      • Configuring your chart
      • Pivot charts
      • Migration guide
    • AI Assistant
    • Version history
    • Scheduled runs
    • Hiding and showing cells
    • Long-running cells
    • Report view
    • Environment variables
    • Git and GitHub
  • Connect to Data
    • Connect your data to DataLab
    • Sharing a Data Source
    • Airtable
    • Amazon Athena
    • Amazon S3
    • Databricks
    • Dropbox
    • Files
    • Google Drive
    • Google BigQuery
    • Google Sheets
    • MariaDB
    • Microsoft SQL Server
    • MongoDB
    • MotherDuck
    • MySQL
    • Oracle Database
    • PostgreSQL
    • Redshift
    • Snowflake
    • Supabase
  • Guides
    • Publish a notebook
    • Importing data from flat files
    • Resizing plots
    • Show Bokeh and Pyvis plots
  • Resources
    • Pricing
    • Manage group settings
    • Reporting for Group Admins
    • DataLab for education
    • Technical requirements
    • Addressing slow code
    • Address R vulnerability
    • Get help
Powered by GitBook
On this page

Was this helpful?

  1. Work

Git and GitHub

PreviousEnvironment variablesNextConnect your data to DataLab

Last updated 11 months ago

Was this helpful?

You can configure and work with Git by leveraging Environment variables. This way, you don't need to enter these details every time you want to push to or pull from a Git repository.

The following environment variables are required to connect to a Git repository. You can choose the name for this set of environment variables freely.

  • GIT_AUTHOR_EMAIL

  • GIT_AUTHOR_NAME

  • GIT_COMMITTER_EMAIL

  • GIT_COMMITTER_NAME

  • GIT_USERNAME

  • GIT_PASSWORD (see below for instructions for GitHub)

After setting up your environment variables and connecting them to your workbook, you can open a terminal by opening the Run menu and choosing Open Terminal. Run the following command:

$ git clone <repository_url>

This command will clone your git repository in a new folder using the name of the repository as the name of the folder. In order to clone into the top level directory of your workbook, the directory your terminal opens up in, you can append . to the command. This will only work if the current directory is empty.

$ git clone <repository_url> .

GitHub

After configuring and connecting the environment variables, you can open a terminal by opening the Run menu and choosing Open Terminal. Now you can clone a private repository for example. Make sure to use the web URL of the GitHub repository, starting with https://:

$ git clone https://github.com/<user>/<private-repo>.git

In order to connect to GitHub, the GIT_PASSWORD environment variable should be a Personal Access Token (PAT). See the to create a PAT with the right permissions.

GitHub documentation
The required environment variables to connect to GitHub, the collection name can be chosen freely