How to remove a remote branch in Git?

Asked

Viewed 10,284 times

6

To delete a local Git branch, just use the command git branch -d <branch>, but how to get this same branch removed on the remote server?

1 answer

9


To remove a remote branch, use the following command:

git push origin --delete <branch>

Note that this command only works for the Git v1.7.0 or later. For older versions, use:

git push origin :<branch>

Inspired response in this answer stack overflow.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.