How to delete branch deploy?

answered
#1

Hi,

I deployed a specific branch on my project (cool feature) and I have deleted it in my repo AND in deploy settings.

But the deploy is still there

How do we delete a branch-deploy (not a deploy-preview) ?

Thanks

#2

Currently there is not a way to delete a deploy.

1 Like
#3

Thanks for your feedback. That’s not … confortable i would say.

#4

If it is something sensitive, you can always contact support direct and have them remove it.

#5

Oh no, not sensible (got lucky thought, a warning would be great) but really not UX friendly I would say, not having the control on what you want or not to be published.

Even on Netlify side I think that would be great not to have VM’s hanging around for people who don’t need them.

#6

Hey Matt,

The challenge is the way Netlify stores files - files’ contents are indexed/attached directly to the deploy object for the first deploy we see them in. And they are not “re-stored” with later deploys in our backing store. You can see we wouldn’t want to keep a zillion copies of jquery.js around, right?

So, we really can’t remove deploys and ensure that your site will continue to work. Your best bet if you want to make sure it’s gone is to delete the site and recreate it. And FYI, we don’t use a per-site VM or really any single-site resources in our network architecture - for serving content we use a general cache that all of our sites share so there are no additional “resources” used in that cache by having old deploys around - it won’t be in the cache, unless people are repeatedly fetching that content (using the deploy-specific URL). So if it’s in cache then…well, it is being used and being served faster than if we had to repopulate the cache from our database again :slight_smile:

But…most people don’t express a desire to delete deploys in the first place, so we haven’t really considered changing the feature before. Could you elaborate on your use case in wanting to remove it?

1 Like
#7

Thanks for your feedback.
Yes, I do believe it is quite a challenge to run a service like Netlify, no question.

Just to give you my usecase last week :

  • Had an issue with a third party js lib
  • Report issue to lib maintainer who asked to see the problem “live”
  • “No problem I use Netlify” : Made a branch from master (“tocbot”) and use branch-deploy
  • Send the branch deploy url to maintainer, who found the problem and closed issue
  • I deleted my branch (no merge)
  • I looked around to delete my deploy, the one from the branch (not the master), impossible.

As a user experience, my 2 cts :

  • I can create a Netlify account and I can delete this account. I am in control. Good UX.
  • I can deploy a site, I can delete this site, I feel in control of what I publish on the internet. Perfect.
  • I can deploy a branch but I cannot delete this branch. I am not in control (bad UX pattern in my personal opinion). I haven’t been warned I couldn’t delete it.
  • In my view and workflow, a branch is temporary, during a lifecycle of a feature before a merge into master. A branch-deploy, I assumed initially, would have had the same behavior.

Some concerns that come to my mind :
What if I publish, by mistake, some sensible information ? I have to delete the whole site and recreate ?
What if, over the span of several month/years I published 50 branches ? I have 50 copies of my website on the internet ?
I have read that Netlify add a “no-index” header to those deploys but if Netlify make a mistake one day (everybody does) and I have suddenly 50 websites that Google considers as duplicate ? Sandbox. Really not great.

Please note
I discovered recently Netlify and I think it is great. Simple and straight to point (a blessing in the SSG exploding market)
This branch (or PR) deploy is a great feature, a great idea, really useful. But I wouldn’t use it anymore now knowing I cannot delete these “drafts”

Thanks
Matt

1 Like
#8

Since we can’t delete a deploy, here is a way to alleviate the case you don’t want to have the branch deploys.

Branch for preview (temporarily)

  • Set your production site with no previews and branch deploys under Continuous Deployment
  • Set up a [new site] to the same repo and build the branch
  • Delete the [new site] when no longer needed
  • Rinse and repeat
#9

Yes, I was thinking about testing this approach in the end. My only concern (I have to test) is that it forces us to update the dns for the subdomain (CNAME pointing to a random Netlify ID that will change with the new website)

#10

You don’t even need to set DNS up - you could always use the netlify sitename (which you can also change to be something consistent like beta-mycompany.netlify.com for each site you set up and then delete in sequence).

If you use Netlify’s DNS hosting, we’ll also automatically “do the right thing” for records like that and remove and recreate them for you to be correct.

1 Like
#11

I’ll try that, thanks

1 Like