How to delete a Git branch (local and remote)
Delete a merged local branch with git branch -d <name>. Use -D to force-delete an unmerged one. To delete it on GitHub too, run git push origin --delete <name>.
Step by step
Switch away from the branch first:
$ git switch mainDelete it locally:
$ git branch -d croissantDelete it on GitHub:
$ git push origin --delete croissant
Deleting a merged branch only removes the label: its commits stay in main's history.