Git module
Lesson 11
Pull requests
Use branches and PRs as the review unit — even when you are a team of one.
beginner30 minRun on your machine
What you will be able to do
- Describe the PR flow: branch → push → review → merge
- Open a PR on GitHub (optional)
- Practice the same flow locally without GitHub
Why this matters for data work
A pull request (merge request) packages commits for review: SQL correctness, secret scan, CI. Solo learners still benefit: future-you reviews past-you.
Concepts
- Branch off
main→ commits → push branch → open PR → merge → delete branch - Description: what / why / how tested
- Protected
main— no direct push (team policy)
Practice on your machine
Local review habit (required)
cd ~/dcubes/git-lab/init-demo
git switch -c feature/pr-practice
echo "-- reviewed change" >> notes.sql
git add notes.sql
git commit -m "Document review note in notes.sql"
git log main..HEAD --oneline
git switch main
git merge feature/pr-practice
git branch -d feature/pr-practice
Optional GitHub PR
If you pushed to GitHub: push the feature branch before merging locally, open “Compare & pull request” in the UI, merge there instead.
What you should see
main..HEADlisted the feature commit before merge.- History on main includes the change after merge.
Common mistakes
- PR with 40 unrelated files — smaller diffs review better.
- Empty PR description — say what you tested.