Technical training · dbt Labs

Git for Data Teams

Branches, commits, and pull requests - the version control workflow every data professional needs to work safely and collaboratively.

Take the quiz Leave feedback
15
minute session
3
learning objectives
1
live demo
4
quiz questions
Presentation

Session slides

Use arrow keys or the buttons below to navigate. Press F for fullscreen.

1 / 9
⎇ technical training
Git for Data Teams
Branches, commits, and pull requests -
the version control workflow every data professional needs
GS
Garrett Stack
Senior Technical Instructor
Session 1 of 1 · 15 min
Learning objectives
By the end of this session…
You will be able to confidently do all three of these things.
1
Explain what a Git branch is and why it prevents broken production data
2
Create a branch, commit a change, and open a pull request in a real terminal
3
Connect this workflow to how dbt Cloud manages changes to your data models
Agenda
What we're covering today
15 minutes, structured to get you hands-on fast.
Time
Topic
Type
0-2 min
Hook - the "final_final_v3" problem
concept
2-5 min
What is a branch? Commits explained
concept
5-10 min
Live demo - branch, commit, pull request
demo
10-12 min
Your turn - try it in the terminal
active
12-14 min
Check for understanding
check
14-15 min
Next steps + the dbt connection
wrap
Hook · activation of prior knowledge
Sound familiar?
"Has anyone ever had a file called final_final_v3_REAL.sql on their desktop?"
revenue_model_FINAL.sql revenue_model_v2.sql revenue_model_v2_fixed.sql revenue_FINAL_REAL.sql USE_THIS_ONE.sql
We've all been there. This is the problem Git solves - not just for software engineers, but for every data team that touches SQL, Python, or dbt models.

Today we'll fix this. For good.
Core concept
Branches & commits, explained

A branch is your test shots pile

Experiment freely without touching the official album. Main stays unchanged until you're ready to merge.

git checkout -b my-fix
📷

A commit is a photograph

Every meaningful change gets a permanent snapshot with a caption. You can always go back to any earlier photo.

git commit -m "fix revenue"
🔀

A PR is showing your photos to the family

Teammates review before anything goes in the album. No surprises in production.

git push - open PR
💡

The mental model

Test shots - photograph - show the family - add to the album.

In dbt Cloud: branch - edit - commit and sync - merge.

Live demo
Let's do this in the terminal
Watch, then you'll try it yourself.
bash - data-project
# Step 1: create a new branch
$ git checkout -b fix/revenue-null-values
Switched to a new branch 'fix/revenue-null-values'
 
# Step 2: make your change, then stage it
$ git add models/revenue.sql
 
# Step 3: commit with a meaningful message
$ git commit -m "handle null values in revenue calc"
[fix/revenue-null-values 3f2a1c] handle null values in revenue calc
 
# Step 4: push and open a PR
$ git push origin fix/revenue-null-values
Active learning · your turn
Try it yourself
You have 2 minutes. I'll be watching and helping.
Scenario: You've been asked to add a new column to a SQL model. You don't want to touch main yet. Create a branch, make a fake change, and commit it.
Step 1 - Create a branch named feature/add-customer-column
Step 2 - Open any .sql file and add a comment line
Step 3 - Stage with git add and commit with a meaningful message
Bonus - Run git log --oneline to see your commit history
Check for understanding
Quick check
Pick the best answer - no pressure.
Your teammate asks you to review their SQL change before it goes to production. Which Git workflow handles this?
A
Push directly to main so everyone gets the update immediately
B
Create a branch, commit the change, open a pull request for review
C
Email the .sql file and ask them to copy-paste it manually
D
Save a new file named revenue_v2_FINAL.sql
B is correct. A pull request is Git's built-in code review workflow - teammates comment on specific lines, approve, and merge when happy. All tracked forever in the project history.
Summary & next steps
What you can do now
Create a branch and work safely without touching main
Commit changes with meaningful messages that explain the why
Open a pull request so teammates can review before merging
The dbt connection: Every dbt Cloud project is a Git repo. When you create a branch in dbt Cloud and edit a model, that's exactly the workflow you practised today - just with a UI on top. You're already thinking like a dbt developer.
📖

Pro Git Book

git-scm.com/book - free, comprehensive

GitHub Skills

skills.github.com - hands-on courses