Cannot delete branch - it is referenced from one or more environments

Hello,

We have a project with three branches: master, preview, and dev-albert. We’ve set up two publish environments: one for the “master” version and another for the “preview” branch.

I want to delete the “dev-albert” branch, but I’m encountering an error: “Cannot delete branch ‘dev-albert’ - it is referenced from one or more environments.”

Upon saving the project to GitHub, I noticed that the default branch was set to “dev-albert”. I’ve since changed it to “master” on GitHub, but I’m still unable to remove the “dev-albert” branch.

Any tricky tip?
Thanks

2 Likes

+1
Cannot delete branch - it is referenced from one or more environments.

It might be worth double-checking how your Environments are currently defined.

1 Like

I have the same problem. I deleted the branch also in github and synced again the remotes in anvil and refreshed the tab. The branch is still there.

Right click delete yields the same error message as mentioned here.