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:
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.
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.
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?
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)
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…