Netlify Split Testing Giving Error: "This feature requires a repository with at least 2 branches." for a repo with 3 branches

Netlify Site Name: heat-pump-instant-quote

Hey all,

I am trying to set up split testing for one of my netlify sites (site name above)

I have a github repository with 3 active branches but when I try to set up split testing I get the following error: “This feature requires a repository with at least 2 branches.”

I also checked under Branches and deploy contexts and my site is set up to deploy all the branches pushed to the repository

I’m 99% certain I should be able to use split-testing now.

Any ideas on why I am still getting this error?

Other steps I tried

  1. changes to let me add individual branches under Branches and deploy contexts

    I then redeployed the site (no luck)
  2. I tried disconnecting and reconnecting the github repo. no luck
  3. I tried switching back to
    All
    Deploy all the branches pushed to the repository. then redeploying my site. No luck

Any help is appreciate thanks!

Hi, @geopopos. You did have the site configured to deploy other branches but you had not yet actually triggered any deploys for branches other than main at the time this topic was created. I do see you deployed other branches after this post was made and that split testing is now enabled.

In other words, the reason that split testing could not be enabled before is that you had only deployed one branch to Netlify when you tried to enable split testing.The split testing feature can only be enabled if there are successful deploys of at least two branches and that condition had not yet been met at the time this post was made.

Hey Luke, I hired someone to do this for me. Going through the netlify documentation I couldn’t find anyway to deploy a branch. Definitely something that would be nice to have in the future.

Thanks for responding!

For anyone who runs into this issue in the future

Objective:
To outline the steps required to deploy a specific branch (other
than main which is entered as production) to a Netlify site and
trigger a deployment.
Verify Available Branches:
Go to the “Site settings” by selecting the site from the
dashboard.
Under “Branches and deploy contexts” in the left menu:
Ensure that the production branch is correctly set to main.
Verify that Branch deploys is configured to deploy code from
all branches, or ensure that specific branches are added for
deployment.

Push the Code to the Branch:
Push the code changes to the specific branch in the GitHub
repository.
Since Branch deploys is enabled, any push to any branch will
appear in the Deploys section of the Netlify dashboard.
Trigger a Deployment:
Go to the Deploys section from the left menu in the Netlify site
dashboard.
Locate the branch you want to deploy.
Click on the “Trigger deploy” dropdown menu next to the
branch name.
Select “Clear cache and deploy site”.
This action will clear the cache and deploy the code from the
selected branch.
Note:
This deployment will build the branch and push the code to a
Netlify link in the format branchname–projectname.netlify.app.
The main link of the project (e.g., projectname.netlify.app) will
still point to the production build, which is based on the main
branch.

thank you for sharing your solution! This is definitely helpful for other users :+1:t6:

1 Like

for sure! i’ll likely accidentally make this mistake again and circle back to it myself :rofl: