Git: Create and delete remote branches

Many git users frequently do create and delete branches. I often forget the command. So i am now writing it down here. May be, it will be useful to some guys out there too.

Create a remote branch

git push origin new_branch

Where origin is your remote name and new_branch is the name of the branch you want to push up.

Delete a remote branch

git push origin :mybranch

This will delete the “mybranch” branch on the origin remote, but you’ll still need to delete the branch locally with

git branch -d mybranch

Hope, it will help you.

Leave a comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.