Why this matters
As a Data Visualization Engineer, you frequently adjust dashboards, SQL models, and chart configs. Branching lets you safely develop changes without breaking production. Pull Requests (PRs) invite review, catch issues early, and document the intent behind changes. Real tasks you will handle:
- Adding a new metric and chart to a KPI dashboard.
- Fixing a broken color scale or axis on a production report.
- Refactoring a SQL model used by multiple visuals and confirming nothing regresses.
With clear branches and PRs, you ship improvements faster and with fewer surprises.
Concept explained simply
- Branch: a named line of work. Use it to develop a feature or fix.
- Main (or master): your stable, deployable branch.
- Pull Request: a request to merge your branch into main after review and checks.
- Review: peers validate logic, performance, and visualization quality.
Mental model: lanes and a gate
Think of branches as separate lanes on a road where you can drive without blocking others. The PR is a gate you pass through after safety checks (tests, review). The gatekeeper (reviewer) ensures the car (your change) is safe to join the highway (main).
Practical defaults for
- Branch types:
feature/for new work,fix/for non-critical fixes,hotfix/for urgent production issues. - Naming:
feature/sales-conversion-rate(short, descriptive, kebab-case). - Commits: small, meaningful messages, e.g.,
feat: add conversion_rate metric to sales model. - PR size: under ~300 lines if possible; split large changes.
- Checks: run linters/tests locally (e.g., SQL checks, dbt build, unit tests for transforms) before opening/merging PR.
Rebase vs merge
- Merge keeps all commits and creates a merge commit.
- Rebase replays your commits atop the latest main for a linear history.
- Team preference varies. If you rebase, do it before opening PR or before final review to reduce noise.
Worked examples
Example 1 — Add a new KPI to a dashboard
- Create a feature branch:
git checkout -b feature/sales-conversion-rate - Modify files: SQL model for conversion rate and dashboard config.
- Commit in small steps:
git add models/sales_conversion.sql git commit -m "feat: add sales conversion rate model" git add dashboards/sales.json git commit -m "feat: add conversion rate chart to sales dashboard" - Update from main and rebase if needed:
git fetch origin git rebase origin/main - Push and open PR:
git push -u origin feature/sales-conversion-ratePR description includes problem, approach, validation steps, and screenshots.
- Address review comments, then merge when checks pass.
Example 2 — Urgent hotfix for a wrong color scale
- Branch from main:
git checkout main git pull git checkout -b hotfix/fix-color-scale-dashboard - Change the color mapping in the dashboard JSON/config.
- Commit and push:
git add dashboards/sales.json git commit -m "fix: correct color scale for revenue bands" git push -u origin hotfix/fix-color-scale-dashboard - Open a small PR, request quick review, merge once checks pass.
Example 3 — Resolve a merge conflict in a chart spec
- You have a PR open for
feature/add-legend. Main changed the same file. - Update and rebase:
git fetch origin git rebase origin/main - Git shows conflicts in
dashboards/sales.json. Edit to keep both the new legend and the recent main changes. - Continue rebase and test locally:
git add dashboards/sales.json git rebase --continue # run validations: dbt build, preview dashboard locally - Push the rebased branch:
git push --force-with-lease - PR updates automatically; request final review and merge.
What to include in a solid PR description
- Context: why this change
- What changed: files, metrics, visuals
- Validation: tests run, screenshots, sample query results
- Impact: dashboards or teams affected
- How to roll back: simple instructions if needed
Hands-on exercises
Practice locally in any Git repository (a sample analytics repo or a new one with placeholder files).
Exercise 1 — Feature branch + PR
Goal: add a new metric and open a PR.
- Create a new branch named
feature/sales-conversion-rate. - Add or edit a SQL/model file that computes
conversion_rate. - Commit with a clear message and push the branch.
- Open a PR with a description: context, change summary, validation steps, and impact.
- Branch created
- Commit message uses conventional style (feat/fix)
- PR description includes validation steps
- CI/tests run clean locally before PR
Exercise 2 — Resolve a merge conflict
Goal: practice rebasing and resolving conflicts.
- On a branch, change a line in a dashboard config (e.g., title or color).
- On
main, change the same line differently and commit. - Rebase your branch onto
main, resolve the conflict, and continue the rebase. - Push with
--force-with-leaseand update the PR.
- Conflict resolved correctly
- Local tests/preview confirm no regressions
- PR notes the conflict resolution for reviewers
Common mistakes and self-check
- Huge PRs that are hard to review. Fix: split into smaller, coherent PRs.
- Vague commit/PR messages. Fix: write the why, what, validation, impact.
- Skipping local checks. Fix: run linters/tests and preview dashboards.
- Branching from an outdated main. Fix:
git fetchand rebase/merge before starting. - Force-pushing without
--force-with-lease. Fix: always use--force-with-lease.
Self-check before requesting review
- Is your branch up to date with main?
- Are tests/linters green locally?
- Did you include before/after screenshots or sample outputs?
- Can a teammate review this in under 15 minutes?
Practical projects
- Personal KPI Board: build a tiny repo with one SQL model and one dashboard JSON; iterate via branches and PRs.
- Visualization Refresh: refactor chart themes across multiple files in small PRs; prove no visual regressions with screenshots.
- Data Model Tightening: add a metric to a dbt-like model and update a chart; document tests and roll-back plan in the PR.
Who this is for
- Data Visualization Engineers collaborating on dashboards and BI assets
- Analytics Engineers and BI Developers contributing to shared repos
- Anyone moving from solo work to team-based analytics development
Prerequisites
- Basic Git: clone, add, commit, push, pull
- Familiarity with your BI/analytics stack (SQL, dashboard configs)
- Local environment to preview changes (optional but helpful)
Learning path
- Branch basics: create, switch, update from main
- PR essentials: small PRs, good descriptions, request review
- Conflict resolution: rebase/merge, fix conflicts safely
- Team conventions: naming, commit style, reviewers, CI checks
- Advanced: draft PRs, cherry-pick, revert strategies
Next steps
- Adopt a branch naming convention for your team
- Create a PR template with context, validation, and impact
- Automate checks (linters/tests) to run on each PR
Mini challenge
Make two parallel changes to the same chart file on different branches, then practice resolving the conflict and documenting the resolution in the PR. Keep each PR under 200 lines and include before/after screenshots.
Ready to test your knowledge?
Take the quick test below. Everyone can take it for free; only logged-in users will have their progress saved.