This post is mostly a note to myself, since I constantly forget how to delete remote Git branches.
The classic way to do so (introduced in Git 1.5) would be:
So, if I were migrating an application from MySQL to PostgreSQL I might want to delete
postgres branch when I’m done:
You have to agree this syntax is hardly something one can easily remember(and I’m extra certain nobody would have guessed it on their own). Fortunately in Git 1.7 a nicer alternative to the above command was introduced:
That’s all from me for today. Now go ahead and delete those unneeded Git branches.
P.S. GitHub users might also want to take a look at this article describing recently added functionality to clean up after pull requests.