This is easy to do, but I always forget how to do it, so this is more a reminder to myself than anything else.
To create and checkout a branch in git :
… or if you have a better memory than me you can do it in one command :
Now we’ve created the branch, committed a bunch of changes, and we want to push it to a remote repository. Regular git push doesn’t do anything :
You have to specify the remote name where you want to push it to (usually origin, depending how you’ve configured things) :
1 2 3 4
The syntax to delete a remote branch is the part I always forget :
Note that this will only delete the remote branch - you’ll still need to delete the branch locally :
If you’re familiar with ruby, you should also checkout the git_remote_branch rubygem , which is designed to make working with remote branches easier.