How to delete a remote branch?

git push -d origin branch_name

To delete a remote branch from your origin use git push -d origin branch_name. The command will remove the branch from your origin (for example on GitHub or GitLab), but keeps your local branch.

Layer 1
Terminal Example
git push -d origin other-branch

- [deleted]         other-branch

See git push to learn more about it.

Last modified on November 30, 2021.

You might also like