(branch)
(commit)
(pull request)
In dbt development workflows, version control using Git is essential for ensuring collaborative, safe, and trackable changes to analytics code. The correct first step when making updates—such as adding new models—is to create a new Git branch. This isolates development work from the production (main) branch, preventing incomplete or experimental logic from affecting deployed transformations. Branching supports dbt’s modular development approach and aligns with best practices for analytics engineering.
Once the branch is created, the developer modifies SQL models, tests, macros, or documentation as required. To permanently record these modifications in Git, the developer must commit the changes. A commit serves as a snapshot of progress and creates an auditable history of transformations made to the project, enabling rollbacks, diffs, and peer review.
After development is complete, the developer submits a pull request (PR). The pull request triggers CI checks—often including dbt build, schema tests, and contract validations—to ensure code quality and identify impacts on downstream models. PRs allow team members to review and comment before changes merge into the main branch, enforcing governance, consistency, and reliability. This workflow embodies the engineering rigor dbt encourages: modular development, testing, versioning, and peer review.