How dbt Cloud guides a user through the basics of Version Control

dbt Cloud is a powerful tool for analysts transitioning to an engineering-like role, after all dbt Labs popularized the termn analytics engineer. One of the strong product features of dbt Cloud is how it makes version control as accessible as possible. In particular this blog refers to using the Cloud IDE.

If you need guidance on repository setup checkout the companion blog to this one here (link to be added in future).

Version Control is the foundation of a dbt Project

The following blog uses screenshots from dbt Cloud and replicating version control situations you will encounter using dbt and how its interface simplifies the version control actions required. With Learngitbranching I am able to replicate the situations with git commands and then explain what dbt Cloud is doing. Ultimately the fact that dbt Cloud makes the version control system more accessible and guided is excellent but it is still important to understand what occurs under the hood which is what this blog hopes to achieve.

dbt Cloud UI eases the introduction to Version Control

Breaking down the Version Control Menu

Location of the Version Control Menu
Close Up of the Options

The button is going to be the most used functionality of the version control menu, it contextually updates based on the relevant version control action to take and we go under the hood of some of these in the next section.

Change branch in the dropdown is your git checkout <branch_name> option. We breakdown what the revert button does and does not do later in the blog. Refresh git state is an option to pull new and updated branches from remote branch to your local branch which is why it is common for a pull option from main down to local branch to become available after selecting this. It is checking for changes in branches in remote and how this relates to the local branch.

Git Branch

If you are on a protected main branch (indicated with the padlock), dbt Cloud suggests creating a branch as the main option in the version control menu:

In this situation dbt Cloud suggests making a branch
Create and checkout branch is the suggested action

Note the change branch option in the top right of the initial screenshot is the equivilent of a git checkout branch_name. Allowing the developer to switch which branch they are currently working on.

Git Commit

Once a developer makes changes in a branch within the Cloud IDE, they will be encouraged to commit those changes (included in this action is a push to remote. It is also worth noting that the Cloud IDE is going to handily colour code changes (additions, alterations and removals) as well as grey out items that are in the .gitignore and are not tracked by git.

In this situation dbt Cloud suggests commiting dev_chang to remote.
Clicking the button will commit and push to remote.

Git Pull

If your dev branch is behind the protected main branch it will prompt you to pull those changes down from Main:

Dev branch is behind the remote main here after fellow teammate has updated main.
The git pull version control option, is equivalent to a git fetch the remote main and then merging that remote main into the dev branch (and offering the developer the opportunity to resolve conflicts.

Pulling the latest version of Main to your development branch might cause conflicts - here the x indicates a conflict, we can opt not to resolve which is in practice a rollback to before the pull from main - the version control button ends up back at Pull from main.

You could resolve these conflicts on the repo platform of your choice, I find dbt Cloud's built-in solution to work well and save the hassle of leaving the Cloud IDE.

GitHub code conflict resolution as part of a merge request

Code Conflict resolution in dbt Cloud

Resolved Conflict

In order to resilve the above code I am going to opt to remove what I have in my dev branch and keep what I pulled from main, but I could also have the two conflicting lines of code (as they were on the same line when I pulled from main and both cannot be true at the same time) on back to back lines and that would have resolved the conflict.

I get the tick for conflicts resolved when I commit the conflict resolution change.

Raise Merge Request (Gain approval for Git Merge)

Dev branch ready to have a request raised to merge back to Main
dev changes merged to main after a request is raised

On a managed repository you cannot raise a merge/pull request you simply merge to main. In production a merge request is preferable to allow for a review of code and review process before merging development code to the main code base.

With a repostiory backed by GitHub/GitLab the version control option to merge is to raise a merge request in that external software, where the merge is then conducted.

Raise Merge Request from within the Cloud IDE

Within GitHub/GitLab you might have approval requirements before you are presented with the option to merge

Merge option

You can also delete the branch after a completed merge that helps keep the project well managed and not sprawling with unused branches.

Once the branch is removed from the repository system it can be removed from dbt Cloud locally with the Prune Branches option in the dropdown where you will be warned which branches are to be pruned.

Here I am pruning the Development branch after it was closed on a successful merge request.

Revert Git Changes

In dbt Cloud we have the option to revert changes:

Revert Option

The documentation does not explain this action but I do not think it is backed by the git revert which creates a ew commit that inverses changes specified as no commit occurs when selecting this button. It appear to serve the same purpose as the rollback to remote option when selecting the ... in the bottom right of the IDE.

This button rolls back the local repository to the most recent version of the remote repository recloning it and restarting the IDE loading up the clone of the remote repo. The revert changes does not include a reclone and restart and seems to just delete all the changes made since the last commit locally (without reference to the remote repository).

Ultimately these two serve a similar objective in reverting back to the most recent commit. Any further rollbacks to particular commits for example should be conducted within the remote repository software.

Conclusion

We covered a lot of ground in this blog with the goal of illustrating the strengths of dbt Cloud in guiding a newer user through version control and making it accessible whilst also explaining what is going on under the interface. Keep an eye out for the partner blog in this series to follow on the different repository options.

Author:
Edward Hayter
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab