# How to split-test between CLI --alias branches?

**URL:** <https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323>\
**Category:** Support\
**Tags:** split-testing\
**Created:** [August 26, 2023, 6:11am UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323 "2023-08-26T06:11:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauricio](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/mauricio/32/54015_2.png) [@mauricio](https://answers.netlify.com/u/mauricio)\
**Post date:** [August 26, 2023, 6:11am UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323/1 "2023-08-26T06:11:24Z")

</div>

Hello!

After reading this: [Split Testing | Netlify Docs](https://docs.netlify.com/site-deploys/split-testing/) I’m trying to setup my first netlify split-test for a React site we deploy using netlify CLI.

We do currently deploy A site like this:  
`netlify deploy --dir=packages/app/build --prod`  
`netlify deploy --dir=packages/app/build --alias=v4`  
`netlify deploy --dir=packages/app/build --branch=main`

and B is deployed like:  
`netlify deploy --dir=packages/app/build --alias=next`  
`netlify deploy --dir=packages/app/build --branch=canary`

(according to --help, --branch is deprecated and we should stick to --alias, but tried both because alias are not being recognized for split-tests)

According to:

> **[Netlify App](https://app.netlify.com/sites/cincel/splits)**
>
> Start building the best web experiences in record time

> This feature requires either [continuous deployment](https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git) or manual deploys with [Netlify CLI](https://docs.netlify.com/cli/get-started/). If you’re not using Netlify CLI, we recommend connecting a Git repository for continuous deployment.

My expectation is that deploying like this, I could setup a test between main and canary; however split config panel does not show any branches.

How to fix this?

Thank you!

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 26, 2023, 2:46pm UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323/2 "2023-08-26T14:46:46Z")

</div>

This is documented in a different section, but relevant here: [Automatic deploy subdomains | Netlify Docs](https://docs.netlify.com/domains-https/custom-domains/automatic-deploy-subdomains/#prerequisites)

 ![image](https://global.discourse-cdn.com/netlify/original/3X/b/e/becccba77b6ccd4cc4825b083deaadb73a437d28.png)

We will update the docs on split testing page as well.

---

<div class="post-metadata">

**Author:** ![mauricio](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/mauricio/32/54015_2.png) [@mauricio](https://answers.netlify.com/u/mauricio)\
**Post date:** [August 26, 2023, 4:39pm UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323/4 "2023-08-26T16:39:22Z")

</div>

Okay so now I understand I’m doing it the wrong way but, what’s the right way to do it?

My site is deployed using the Netlify CLI and it is **not** using the Netlify git integration.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 26, 2023, 4:44pm UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323/5 "2023-08-26T16:44:58Z")

</div>

You can’t do this with CLI. Split testing requires branches, which requires git. You can use Edge Functions: [Set up an AB Test | Edge Functions on Netlify (edge-functions-examples.netlify.app)](https://edge-functions-examples.netlify.app/example/abtest)

---

<div class="post-metadata">

**Author:** ![mauricio](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/mauricio/32/54015_2.png) [@mauricio](https://answers.netlify.com/u/mauricio)\
**Post date:** [August 26, 2023, 4:51pm UTC](https://answers.netlify.com/t/how-to-split-test-between-cli-alias-branches/100323/6 "2023-08-26T16:51:58Z")

</div>

Thank you very much.

I’ll consider available options and pick one.

EDIT: any expectations of ever being able to split-test between CLI deployments?
