Git folders

Databricks · Notebooks & Development

Theory

Git folders (formerly Repos) connect a folder in your workspace to a remote Git repository on GitHub, GitLab, Azure DevOps, Bitbucket and other providers. You clone a repository into the workspace, and the notebooks, Python files and other files in it behave like normal workspace files, but you can switch branches, pull, commit and push from the Git dialog inside Databricks.

To create one, go to Workspace, open Create → Git folder, paste the Git repository URL, pick the Git provider and click Create Git folder. The branch button next to a notebook's name opens the Git dialog, where you see changed files, write a commit message and click Commit & Push, or click Pull to get teammates' changes. For example, Ravi clones techtown-dbx, creates the branch feature/orders-merge, edits orders_etl and pushes; a pull request on GitHub then reviews the change before it reaches main.

Why we use it

Notebooks without version control get overwritten and are hard to review. Git folders bring branches, pull requests and CI/CD to Databricks code, so teams can collaborate safely and deploy the same code to dev and prod.

When to use it

Use a Git folder for any code you share or deploy. Each developer should work in their own Git folder and branch. For deploying jobs and pipelines, combine Git with Declarative Automation Bundles rather than editing production folders by hand.

How it works

  1. Workspace → Create → Git folder
  2. Paste the repository URL and click Create Git folder
  3. Create or switch to a feature branch
  4. Edit notebooks and files
  5. Ready to share the change? Yes: Commit & Push from the Git dialog. No: Keep editing; Pull to get others' work.
  6. Open a pull request in GitHub, GitLab or Azure DevOps

Syntax

Workspace → Create → Git folder → Git repository URL, Git provider, Git folder name → Create Git folder
Git dialog: branch button → Pull | Commit & Push | Create Branch
User menu → Settings → Linked accounts (Git credentials)

Example

# Inside a Git folder, Python files can be imported directly
# Repo layout:
#   techtown-dbx/
#     src/transforms.py   -> def add_gst(df): ...
#     notebooks/orders_etl

from src.transforms import add_gst

orders = spark.read.table("main.sales.orders")
display(add_gst(orders))

# Then: branch button → review changes → message 'Add GST column' → Commit & Push

Key points

Databricks topics

Databricks Fundamentals

Compute

Notebooks & Development

Apache Spark on Databricks

Delta Lake

Unity Catalog & Governance

Data Ingestion

Declarative Pipelines (Lakeflow)

Lakeflow Jobs

Databricks SQL & BI

Architecture, Performance & Cost

Machine Learning & AI

Certification & Interview

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Master Databricks

The lakehouse platform from the ground up: Apache Spark, Delta Lake, Unity Catalog, Lakeflow pipelines and jobs, Databricks SQL and MLflow. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice SQL / Spark SQL Sharpen the SQL you use in Databricks SQL and Spark SQL: 150 query problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Databricks  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

{{ sec.h }}

{{ sec.body }}

{{ sec.body }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
Want to run this yourself? Databricks needs a real workspace — there's no in-browser engine for it. Click Copy above, then paste it into a notebook or the SQL editor in Databricks Free Edition (free, no credit card) and run it on serverless compute.
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic