How to Permanently Delete a Git Branch (Locally and Remotely)
A clear, no-nonsense guide to deleting Git branches for good, locally, on GitHub/GitLab, and from every teammate's machine, with the exact commands.
How to Permanently Delete a Git Branch (Locally and Remotely)
A clear, no-nonsense guide to deleting Git branches for good, locally, on GitHub/GitLab, and from every teammate's machine, with the exact commands and the mistakes that bring "deleted" branches back. You merged the feature, the PR is closed, and you delete the branch. A week later it's back in your branch list like nothing happened. If that's why you're here, you're not losing your mind. Git branches have a habit of resurrecting themselves, and there's a specific reason for it that almost nobody explains properly. This guide covers the actual deletion commands, why a branch sometimes refuses to die, and the one step most tutorials skip that lets it come back from the dead on every machine that ever pulled it. The short version, if you just need the commands Delete a local branch: git branch -d branch-name Delete a remote branch (GitHub, GitLab, Bitbucket, anywhere): git push origin --delete branch-name If that's all you needed, you're done. If you wa…