Can't enable branch subdomains

Netlify site name: catrats.netlify.app

I’m using Gitlab and I’ve deployed my site using the manual Netlify CLI deploy. I’ve configured my domain to use Netlify domain servers. So I can reach my site through catsrats.io and www.catsrats.io. Automatic deploys work when pushing to main-branch.

The problem is that I want to deploy subdomain using branches. I’ve created and pushed a branch called test to my repository. But in my Domain management it tells me that I don’t have any branches:

What could be causing this? How can I add my test branch as a subdomain to get it deployed at test.catsrats.io?

Welcome to the forums @salake

Have you deployed the branch to Netlify too? You need to deploy before the Branch subdomains become available.

Hi and thanks for you reply.

What do you mean by deploying the branch to Netlify? I’ve added it here, in my site settings:

Is there another step I need to do?

A per Branch deploy controls documentation

Once you select some or all of your branches for branch deploys, Netlify will start watching those branches for new commits and pull/merge requests. As soon as you start pushing changes to those branches, you’ll find new deploys for those branches.

Did you add it before or after you created the branch in Gitlab? If you did added the branch to Netlify after creating the branch in Gitlab you will need to commit to the branch again in order to trigger the build.

It was added before pushing to the branch. And I’ve made more commits to the branch today as well. It’s still not showing up in Domain mangement

In the list of deploys do you see any that say Branch Deploy?

No, this is how it looks

Any help on how to resolve this?

salake, i am not sure if this got covered above, but your subdomain needs to match the name of the branch exactly. so, if you want to have toaster.catsrats.io you will need to make and then deploy a branch called toaster to your git provider; not toast, not not toasters - neither of those will work.

can you confirm this happened? if yes, let us know and we can take another look.

1 Like

Hi! As you can see in the very first post I made here I do have a branch named test pushed to the same git repo that’s being deployed correctly. I.e: my main branch works; pushing to main automatically issues a new build and deploys it through Netlify. But I still can’t see test branch under Branch subdomains.

Could you have another look at it? Is there any way to add a branch subdomain through the Netlify CLI?

Hey @salake,

Could you try to relink the repo from the UI?

I started terminal, navigated into the local dir of my project and then ran
netlify unlink

it worked.

I then tried running netlify link. I choose to use the same repository. It didn’t work.

Terminal output:

MacBook-Air:web user$ netlify link

netlify link will connect this folder to a site on Netlify

? How do you want to link this folder to a site? Use current git remote origin (https://gitlab.com/catrats-nft/web)

Looking for sites connected to 'https://gitlab.com/catrats-nft/web'...

No Matching Site Found

No site found with the remote https://gitlab.com/catrats-nft/web.

Double check you are in the correct working directory and a remote origin repo is configured.

Run git remote -v to see a list of your git remotes.

Could this be a permission issue? Because of my repo being private? (you can’t reach https://gitlab.com/catrats-nft/web if you are not allowed access to it)

Hi @salake ,

It doesn’t look like you’ve unlinked the repo from what I see in the UI. Could you try to relink the repo from the UI, as Hrishikesh mentioned, and let us know how that goes?

To change which repository is linked to your site, go to Site settings > Build & deploy > Continuous deployment > Build settings , select Edit settings , then Link to a different repository .

I’ve relinked it via the UI, added test as a individual deploy branch, made a change to the branch and pushed it to the repo. I still don’t see it under branch subdomains…

Your branch deploy failed: Netlify App

The deploy needs to succeed to get it working.

Thanks for all of your great feedback. I’ve reached a working state now. Great customer support :clap:

1 Like