Search code examples
gitgithubgithub-for-windows

GitHub: Unable to delete main branch from remote repository after changing default branch to master


I am unable to delete main branch from my remote repository after changing my default branch to master.

I made a repository on github and pushed the branch named master from my local repository to it. Then i changed the default branch to master as it contained files i wanted to keep and remove the "main" branch but the delete icon isnt responding.

enter image description here

the option to delete main branch is not working


Solution

  • Do you see that tiny shield icon?

    Highlighted image

    It means you have branch protection active.
    You need to allow deletions.

    unchecked deletion option

    You will find the active rules at <your-repository-link>/settings/branches.