Git & GitHub Basics for Analysts
Part of the Data Analyst Roadmap
In short
"final_query_v3_REAL_final.sql" is a cry for help. Git keeps every version of your work with a note on what changed, and GitHub lets your team see and review it.
Enough Git to track changes to your SQL scripts and notebooks and share work with a team — commit, push, pull, and basic branching, without needing full software-engineering-level Git mastery.

Think of it like this
Mummy's recipe notebook
Every time Mummy tweaks her rajma recipe, she writes the new version on a fresh page with the date and a note: "less salt, more tomato". Old pages stay, so she can always go back. Git does this for your queries, page by page.
Watch it happen
Fixing a query the Git way
git clone
1/6You download the team's repository, a folder whose full history Git tracks.
The big ideas
What you need to know
Commit = saved snapshot
A commit records exactly what changed, who changed it and a message explaining why.
Branch = safe sandbox
Work on a branch so the main version stays clean while you experiment.
Pull request = review
Ask a teammate to check your change on GitHub before it goes into main. Two eyes catch more bugs.
Nothing is really lost
Every past version stays in history. You can see what a query looked like last March in seconds.
See it in code
Walk through the code
1git clone https://github.com/your-team/sales-analysis.git2cd sales-analysis3git switch -c fix-churn-query4# ...edit queries/churn.sql...5git status6git add queries/churn.sql7git commit -m "Use 90-day window for churn"8git push -u origin fix-churn-query1/4Clone copies the repository and its history to your laptop.
The everyday loop: clone once, then branch, edit, commit and push for each change.
Save yourself the pain
Common mistakes
Oops
Writing commit messages like "update" or "changes".
Do this instead
Say what and why: "Exclude test accounts from WAU". Future you will be grateful.
Oops
Committing straight to main without anyone looking.
Do this instead
Use a branch and a pull request, even on small teams. Reviews catch silent logic errors.
Your mission
Your first analysis repo
Quick check
Why work on a branch instead of directly on main?
Go deeper
- 1Create a GitHub account and push a small SQL/notebook project to a repository.
- 2Practice a basic commit-push-pull cycle on a personal project.
- 3Learn to write a clear commit message describing what changed and why.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.