xud9iw
Last Updated: February 25, 2016
·
1.896K
· abh1nv
693bb0b442cf21466ff85725f169dc2c

Delete local and remote Git branches

Delete a local branch:

git branch -D mybranch

Delete a remote branch (essentially pushes 'null' to the remote branch):

git push remotename :mybranch

Delete local and remote together (thanks to zzet's comment):

git push remotename --delete :mybranch
Say Thanks
Respond

2 Responses
Add your response

1266
73dadffd17a47b9d497e3699bdfc6e0f

git push remotename --delete :mybranch

over 1 year ago ·
1905
Photo on 08.01.2013 at 04.15

git push origin :mybranch actually mean push local branch "" (empty branch) to branch "mybranch" on origin. You can also push other local branches. Example: git push heroku develop:master, that pushes local develop branch to master on heroku.

over 1 year ago ·
Filed Under