Skip to main content

Delete a remote branch with git

To delete a remote branch, you can’t use the git branch command. Instead, use the git push command with --delete flag, followed by the name of the branch you want to delete. You also need to specify the remote name (origin in this case) after git push.

git branch -a

Will give you an overview of all branches of all remotes ...

git push origin --delete testbranch

Will delete the branch 'testbranch' in the remote repository named origin