Creating new branches and deleting them locally is an easy task with git, but when it comes to doing it for a remote repository, happily, it is very easy too.

Pushing a branch

If you have a new branch named mybranch on your local repository and you want to push it to a remote so other people can see it you can do:

1
git push remotename mybranch

Most of the time you will probably want to push to the origin remote, so the command will be something like this:

1
git push origin mybranch

Deleting a branch

Deleting a remote branch has a syntax that feels a little weird, but it remains an easy task. If you wanted to delete a branch named mybranch from a remote you would do this:

1
git push remotename :mybranch

The way to see this command is like pushing empty to a remote. So you are telling git to go to remotename then find mybranch and push empty on it. This sounds weird, but what it really does is deleting the branch.

[ git  github  ]
Hooking your github project to Travis-CI
Contributing to OpenHatch project
Creating and applying patches with git
Getting more from git log
How to delete a commit in git, local and remote