Categories: Varia

Change the Default Git Branch for a dbt Cloud Project

In dbt, you can link your project to a github account, which is obviously the right thing to do. By default, the project uses the main branch. But what if you have two dbt projects; one for dev and one for prd? And in the dev project, you want to change the default branch to another branch, for example main-dev? (in this case, deploying to production would mean doing a pull request where you merge the main-dev branch into the main branch)

It took me some time to figure out how to do this, since this isn’t that straight forward in the dbt cloud interface (well, it is when you know where to look). Hence this blog post.

You might think you can change it in the account settings under project.

When you go to your project, you can view and edit repository settings.

But there’s no setting for the default branch. To change this, we need to go to the environments section of the project, which can be found under deploy.

Choose the Development environment.

Go to its settings.

And there we can find the configuration for the default branch. Hit the edit button at the top.

Now we can specify which branch we want to use for the project:

Hit Save, and go back to the develop section of dbt cloud. You will be asked to refresh the IDE interface. And that’s it. The project will now use your custom branch. This means that branch is read-only and it can only be updated through pull requests.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

Recent Posts

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

I'm hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM UTC.…

5 days ago

dataMinds Connect 2024 – Session Materials

The slides and scripts for my session "Tackling the Gaps & Islands Problem with T-SQL…

4 weeks ago

Connect to Power BI as a Guest User in another Tenant

Sometimes your Microsoft Entra ID account (formerly known as Azure Active Directory) is added as…

2 months ago

How to use a Script Activity in ADF as a Lookup

In Azure Data Factory (ADF, but also Synapse Pipelines and Fabric Pipelines), you have a…

4 months ago

Database Build Error – Incorrect syntax near DISTINCT

I wrote a piece of SQL that had some new T-SQL syntax in it: IS…

4 months ago

Speaking at dataMinds Connect 2024

I'm very excited to announce I've been selected as a speaker for dataMinds Connect 2024,…

5 months ago