# Netlify-cli deploys with --alias has cache?

**URL:** <https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611>\
**Category:** Support\
**Tags:** netlify-cli, netlify-newbie, deployment\
**Created:** [December 3, 2020, 4:00pm UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611 "2020-12-03T16:00:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gedco\_Sistemas](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/gedco_sistemas/32/19272_2.png) [@Gedco\_Sistemas](https://answers.netlify.com/u/Gedco_Sistemas)\
**Post date:** [December 3, 2020, 4:00pm UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/1 "2020-12-03T16:00:08Z")

</div>

Dear Community,

In our Gitlab CI/CD pipeline, when we issue the command:

```
netlify deploy --alias "$CI_COMMIT_REF_NAME" --message "Deployado desde rama $CI_COMMIT_REF_NAME commit $CI_COMMIT_SHORT_SHA"

```

Everything seems fine:

```
Logs: https://app.netlify.com/sites/mcc-adm-es/deploys/5fc81a1977d2340e5e725215
Website Draft URL: https://master--mcc-adm-es.netlify.app

```

But the changes are not the latest deployed. But, if I open this unique URL:

```
https://5fc81a1977d2340e5e725215--mcc-adm-es.netlify.app/

```

This URL is the right. Its work fine and have the latest changes deployed.

Why the alias URL is not refreshed with the latest changes and the unique URL works fine ?

Our Site-ID is: `02c9b8d5-c0c9-40a9-8d51-f9c86b793d80`

Thanks in advance, and best regards.

P.D.: Soy for my bad English.

P.D.2: The $CI\_COMMIT\_REF\_NAME env var contains the “master” string. I double checked that.

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [December 4, 2020, 7:19am UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/2 "2020-12-04T07:19:45Z")

</div>

Hi, @Gedco_Sistemas. Alias deploys are not branch deploys. I go into more detail about why this is so here:

> [@Trunk-based development questions](https://answers.netlify.com/t/trunk-based-development-questions/26137/3):
>
> Hi, @jega. It sounds like you are considering using a unique site for each “trunk”. I was going to recommend this myself. If you are using different git branches then using our [branch subdomain](https://docs.netlify.com/domains-https/custom-domains/multiple-domains/#branch-subdomains) feature makes sense. You are not using different git branches so this won’t work for you. The next best workaround is just to use different sites as you have suggested. Also, I want to warn you about a “false workaround”. It is a possible solution some people have already tried and it doesn’t work. So,…

If there are question after reading that, please let us know.

---

<div class="post-metadata">

**Author:** ![Gedco\_Sistemas](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/gedco_sistemas/32/19272_2.png) [@Gedco\_Sistemas](https://answers.netlify.com/u/Gedco_Sistemas)\
**Post date:** [December 4, 2020, 10:40pm UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/3 "2020-12-04T22:40:33Z")

</div>

Dear @luke, thanks for your quick reply.

Ok, I learn that Alias deploys aren’t branches deploy. So, what’s is the alias flag for ? I can’t imagine an use case for this…

[https://cli.netlify.com/commands/deploy](https://cli.netlify.com/commands/deploy)

> - `alias` ( _string_ ) - Specifies the alias for deployment. Useful for creating predictable deployment URL’s

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [December 7, 2020, 1:12am UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/4 "2020-12-07T01:12:32Z")

</div>

Hi, @Gedco_Sistemas. It is for exactly what is says: “Useful for creating predictable deployment URL’s”.

It is just important to understand that they are not treated in the same ways as branch deploys (because they aren’t).

---

<div class="post-metadata">

**Author:** ![Gedco\_Sistemas](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/gedco_sistemas/32/19272_2.png) [@Gedco\_Sistemas](https://answers.netlify.com/u/Gedco_Sistemas)\
**Post date:** [December 7, 2020, 1:32am UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/5 "2020-12-07T01:32:42Z")

</div>

Hi, ok.

Sorry, but then why when I use `--alias master` to deploy, I don’t see the last changes I made push?

Is ‘master’ a reserved word? Should I have to use another word to test, such as cat or dog? Then there would be a `https://dog--mcc-adm-es.netlify.app` ?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [December 7, 2020, 3:04am UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/6 "2020-12-07T03:04:10Z")

</div>

Hi, @Gedco_Sistemas. It was reserved when you deployed a branch with that same name, `master`. So now that subdomain (`master--mcc-adm-es`) is reserved for branch deploys to that branch. If you try to use it as an alias it fails to update because it was already used for a branch deploy. The branch deploy take precedence over the alias.

---

<div class="post-metadata">

**Author:** ![Gedco\_Sistemas](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/gedco_sistemas/32/19272_2.png) [@Gedco\_Sistemas](https://answers.netlify.com/u/Gedco_Sistemas)\
**Post date:** [December 7, 2020, 12:14pm UTC](https://answers.netlify.com/t/netlify-cli-deploys-with-alias-has-cache/27611/7 "2020-12-07T12:14:00Z")

</div>

Perfect. Thank you very much for the patience and time invested in clarifying our doubts.

We have been using Netlify for a while and we are very pleased with the service.

Keep the good work. Cheers from Buenos Aires.
