Delete a remote Git branch

CLI

Git

Branch

Delete remote

Luc B.

Git

To reduce clutter in remote git repositories, it helps to delete stale branches.

Code Example

Use the --delete flag to git push to delete a branch in a remote repository.

git push origin --delete my-stale-branch

Replace origin with the appropriate git remote and my-stale-branch with the name of the branch to delete.