I'm Jason, a web application developer in East Tennessee.

Deleting Git Branches in Remote Repository

I had recently used a branch to handle all the modifications I was making to a system for a Rails 3.1 upgrade from Rails 2.4.3. After I merged my changes back into the master branch, I deleted the ‘rails3’ branch locally, but it still remained on the remote server.

I found that ‘git push origin :branch_name’ will delete the repository from the remote server if the branch has been removed locally.

$ git push origin :rails3
 - [deleted]         rails3
comments powered by Disqus