Skill 2.3.5

Manage branching, pull requests, and conflict resolution

Key Concepts

In a trunk-based or short-lived feature branch model, each change is made on a branch, pushed and merged into main through a pull request. The pull request triggers the build, code analysis and tests, and reviewers check the schema change and the generated deploy report, looking for data loss such as dropped or narrowed columns.

Because SQL projects are declarative with one file per object, two developers usually change different files and merge cleanly. A merge conflict occurs when both change the same object file; it is resolved by editing the file to the intended final definition, rebuilding to validate references, and rerunning tests. Rebasing or merging main into the branch before the pull request completes keeps the branch current. Renames should be done with the project's refactor feature so the refactor log tells the deployment to rename rather than drop and re-create.