Thursday, 3 November 2011

Git Command - Including Deleting Remote Branch

Handy site to remember git commands:
http://gitref.org

The daddy of refs:
http://progit.org/book

A non obvious command to delete a remote branch.

First do git branch -d [branchName] locally
Then: git push origin :[branchName]

This is based on refspecs - doco for which is can be found here:
http://progit.org/book/ch9-5.html

Basically this is saying push an empty reference to [branchName] on the remote system.  That has the effect of deleting it.

No comments:

Post a Comment