Last Updated: February 25, 2016
· adamjonas

Deleting remote branches

git push <remote> :<remote_branch>

in my case

git push origin :oauth-config

2 Responses
Add your response


There is more intuitive

git push --delete origin branch_name

in git for several versions already.

over 1 year ago ·

what you're doing is using git's ability to not have a 1 to 1 push requirement.

You can do:

git push origin experimental_branch:master

and that will push your experimental branch to the master branch.

git push origin :master 

is pushing "nothing" to master thereby deleting it.

over 1 year ago ·